Sourcegraph API

Queries

accessRequests

Description

List access requests.

Response

Returns an AccessRequestConnection!

Arguments
Name Description
status - AccessRequestStatus
first - Int Returns the first n access requests from the list.
last - Int
after - String
before - String

Example

Query
query accessRequests(
  $status: AccessRequestStatus,
  $first: Int,
  $last: Int,
  $after: String,
  $before: String
) {
  accessRequests(
    status: $status,
    first: $first,
    last: $last,
    after: $after,
    before: $before
  ) {
    totalCount
    nodes {
      ...AccessRequestFragment
    }
    pageInfo {
      ...BidirectionalPageInfoFragment
    }
  }
}
Variables
{
  "status": "PENDING",
  "first": 987,
  "last": 987,
  "after": "xyz789",
  "before": "abc123"
}
Response
{
  "data": {
    "accessRequests": {
      "totalCount": 987,
      "nodes": [AccessRequest],
      "pageInfo": BidirectionalPageInfo
    }
  }
}

areExecutorsConfigured

Description

Returns true if executors have been configured on the Sourcegraph instance. This is based on heuristics and doesn't necessarily mean that they would be working.

Response

Returns a Boolean!

Example

Query
query areExecutorsConfigured {
  areExecutorsConfigured
}
Response
{"data": {"areExecutorsConfigured": false}}

autocompleteMembersSearch

Description

Search for users that opt-in to search autocomplete.

Arguments
Name Description
organization - ID! The organization ID
query - String! Return users whose usernames or display names match the query.

Example

Query
query autocompleteMembersSearch(
  $organization: ID!,
  $query: String!
) {
  autocompleteMembersSearch(
    organization: $organization,
    query: $query
  ) {
    id
    username
    displayName
    avatarURL
    inOrg
  }
}
Variables
{
  "organization": "4",
  "query": "xyz789"
}
Response
{
  "data": {
    "autocompleteMembersSearch": [
      {
        "id": 4,
        "username": "xyz789",
        "displayName": "xyz789",
        "avatarURL": "abc123",
        "inOrg": false
      }
    ]
  }
}

availableBulkOperations

Description

Returns a list of available bulk operations for changesets belonging to a batch change.

Response

Returns [BulkOperationType!]!

Arguments
Name Description
batchChange - ID! The batch change the selected changesets belong to.
changesets - [ID!]! The changesets to query for bulk operations applicable to.

Example

Query
query availableBulkOperations(
  $batchChange: ID!,
  $changesets: [ID!]!
) {
  availableBulkOperations(
    batchChange: $batchChange,
    changesets: $changesets
  )
}
Variables
{"batchChange": 4, "changesets": ["4"]}
Response
{"data": {"availableBulkOperations": ["COMMENT"]}}

backgroundJobs

Description

Get a list of background jobs that are currently known in the system.

Response

Returns a BackgroundJobConnection!

Arguments
Name Description
first - Int Returns the first n jobs. If omitted then it returns all of them.
after - String Opaque pagination cursor.
recentRunCount - Int The maximum number of recent runs to return for each routine.

Example

Query
query backgroundJobs(
  $first: Int,
  $after: String,
  $recentRunCount: Int
) {
  backgroundJobs(
    first: $first,
    after: $after,
    recentRunCount: $recentRunCount
  ) {
    nodes {
      ...BackgroundJobFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "first": 123,
  "after": "xyz789",
  "recentRunCount": 987
}
Response
{
  "data": {
    "backgroundJobs": {
      "nodes": [BackgroundJob],
      "totalCount": 987,
      "pageInfo": PageInfo
    }
  }
}

batchChange

Description

Looks up a batch change by namespace and name.

Response

Returns a BatchChange

Arguments
Name Description
namespace - ID! The namespace where the batch change lives.
name - String! The batch changes name.

Example

Query
query batchChange(
  $namespace: ID!,
  $name: String!
) {
  batchChange(
    namespace: $namespace,
    name: $name
  ) {
    id
    namespace {
      ...NamespaceFragment
    }
    name
    description
    state
    creator {
      ...UserFragment
    }
    lastApplier {
      ...UserFragment
    }
    viewerCanAdminister
    url
    createdAt
    updatedAt
    lastAppliedAt
    closedAt
    changesetsStats {
      ...ChangesetsStatsFragment
    }
    changesets {
      ...ChangesetConnectionFragment
    }
    changesetCountsOverTime {
      ...ChangesetCountsFragment
    }
    diffStat {
      ...DiffStatFragment
    }
    currentSpec {
      ...BatchSpecFragment
    }
    bulkOperations {
      ...BulkOperationConnectionFragment
    }
    batchSpecs {
      ...BatchSpecConnectionFragment
    }
  }
}
Variables
{
  "namespace": "4",
  "name": "abc123"
}
Response
{
  "data": {
    "batchChange": {
      "id": 4,
      "namespace": Namespace,
      "name": "abc123",
      "description": "abc123",
      "state": "OPEN",
      "creator": User,
      "lastApplier": User,
      "viewerCanAdminister": false,
      "url": "abc123",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "lastAppliedAt": "2007-12-03T10:15:30Z",
      "closedAt": "2007-12-03T10:15:30Z",
      "changesetsStats": ChangesetsStats,
      "changesets": ChangesetConnection,
      "changesetCountsOverTime": [ChangesetCounts],
      "diffStat": DiffStat,
      "currentSpec": BatchSpec,
      "bulkOperations": BulkOperationConnection,
      "batchSpecs": BatchSpecConnection
    }
  }
}

batchChanges

Description

A list of batch changes.

Response

Returns a BatchChangeConnection!

Arguments
Name Description
first - Int Returns the first n batch changes from the list. Default = 50
after - String Opaque pagination cursor.
state - BatchChangeState Only return batch changes in this state. If states is also specified, it will take precedence over state.
states - [BatchChangeState!] Only return batch changes in any of these states. If state is also specified, states will take precedence over it.
viewerCanAdminister - Boolean Only include batch changes that the viewer can administer.

Example

Query
query batchChanges(
  $first: Int,
  $after: String,
  $state: BatchChangeState,
  $states: [BatchChangeState!],
  $viewerCanAdminister: Boolean
) {
  batchChanges(
    first: $first,
    after: $after,
    state: $state,
    states: $states,
    viewerCanAdminister: $viewerCanAdminister
  ) {
    nodes {
      ...BatchChangeFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "first": 50,
  "after": "xyz789",
  "state": "OPEN",
  "states": ["OPEN"],
  "viewerCanAdminister": false
}
Response
{
  "data": {
    "batchChanges": {
      "nodes": [BatchChange],
      "totalCount": 987,
      "pageInfo": PageInfo
    }
  }
}

batchChangesCodeHosts

Description

All globally configured code hosts usable with Batch Changes.

Response

Returns a BatchChangesCodeHostConnection!

Arguments
Name Description
first - Int Returns the first n code hosts from the list. Default = 50
after - String Opaque pagination cursor.

Example

Query
query batchChangesCodeHosts(
  $first: Int,
  $after: String
) {
  batchChangesCodeHosts(
    first: $first,
    after: $after
  ) {
    nodes {
      ...BatchChangesCodeHostFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{"first": 50, "after": "xyz789"}
Response
{
  "data": {
    "batchChangesCodeHosts": {
      "nodes": [BatchChangesCodeHost],
      "totalCount": 987,
      "pageInfo": PageInfo
    }
  }
}

batchSpecs

Description

A list of batch specs.

Site-admin only.

Experimental: This API is likely to change in the future.

Response

Returns a BatchSpecConnection!

Arguments
Name Description
first - Int Returns the first n batch specs from the list. Default = 50
after - String Opaque pagination cursor.
includeLocallyExecutedSpecs - Boolean Include locally executed (i.e. with src-cli) batch specs in the list of specs returned.
excludeEmptySpecs - Boolean Exclude the empty batch specs that are initially created and applied to draft batch changes.

Example

Query
query batchSpecs(
  $first: Int,
  $after: String,
  $includeLocallyExecutedSpecs: Boolean,
  $excludeEmptySpecs: Boolean
) {
  batchSpecs(
    first: $first,
    after: $after,
    includeLocallyExecutedSpecs: $includeLocallyExecutedSpecs,
    excludeEmptySpecs: $excludeEmptySpecs
  ) {
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
    nodes {
      ...BatchSpecFragment
    }
  }
}
Variables
{
  "first": 50,
  "after": "xyz789",
  "includeLocallyExecutedSpecs": true,
  "excludeEmptySpecs": false
}
Response
{
  "data": {
    "batchSpecs": {
      "totalCount": 123,
      "pageInfo": PageInfo,
      "nodes": [BatchSpec]
    }
  }
}

checkBatchChangesCredential

Description

Determines if a batch change credential is authorized for a code host.

Response

Returns an EmptyResponse!

Arguments
Name Description
batchChangesCredential - ID!

Example

Query
query checkBatchChangesCredential($batchChangesCredential: ID!) {
  checkBatchChangesCredential(batchChangesCredential: $batchChangesCredential) {
    alwaysNil
  }
}
Variables
{"batchChangesCredential": "4"}
Response
{
  "data": {
    "checkBatchChangesCredential": {
      "alwaysNil": "xyz789"
    }
  }
}

clientConfiguration

Description

The configuration for clients.

Response

Returns a ClientConfigurationDetails!

Example

Query
query clientConfiguration {
  clientConfiguration {
    contentScriptUrls
    parentSourcegraph {
      ...ParentSourcegraphDetailsFragment
    }
  }
}
Response
{
  "data": {
    "clientConfiguration": {
      "contentScriptUrls": ["abc123"],
      "parentSourcegraph": ParentSourcegraphDetails
    }
  }
}

codeHostSyncDue

Description

Returns true if any of the code hosts supplied are syncing now or within "seconds" from now.

Response

Returns a Boolean!

Arguments
Name Description
ids - [ID!]!
seconds - Int!

Example

Query
query codeHostSyncDue(
  $ids: [ID!]!,
  $seconds: Int!
) {
  codeHostSyncDue(
    ids: $ids,
    seconds: $seconds
  )
}
Variables
{"ids": ["4"], "seconds": 123}
Response
{"data": {"codeHostSyncDue": true}}

codeHosts

Description

List of all configured code hosts on this instance.

Site-admin only.

Response

Returns a CodeHostConnection!

Arguments
Name Description
first - Int Default = 50
after - String
search - String

Example

Query
query codeHosts(
  $first: Int,
  $after: String,
  $search: String
) {
  codeHosts(
    first: $first,
    after: $after,
    search: $search
  ) {
    isMigrationDone
    nodes {
      ...CodeHostFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
    totalCount
  }
}
Variables
{
  "first": 50,
  "after": "xyz789",
  "search": "xyz789"
}
Response
{
  "data": {
    "codeHosts": {
      "isMigrationDone": true,
      "nodes": [CodeHost],
      "pageInfo": PageInfo,
      "totalCount": 123
    }
  }
}

codeIntelSummary

Description

Provides a summary of code intelligence on the instance.

Response

Returns a CodeIntelSummary!

Example

Query
query codeIntelSummary {
  codeIntelSummary {
    numRepositoriesWithCodeIntelligence
    repositoriesWithErrors {
      ...CodeIntelRepositoryWithErrorConnectionFragment
    }
    repositoriesWithConfiguration {
      ...CodeIntelRepositoryWithConfigurationConnectionFragment
    }
  }
}
Response
{
  "data": {
    "codeIntelSummary": {
      "numRepositoriesWithCodeIntelligence": 123,
      "repositoriesWithErrors": CodeIntelRepositoryWithErrorConnection,
      "repositoriesWithConfiguration": CodeIntelRepositoryWithConfigurationConnection
    }
  }
}

codeIntelligenceConfigurationPolicies

Description

Returns precise code intelligence configuration policies that control data retention and (if enabled) auto-indexing behavior.

Arguments
Name Description
repository - ID If repository is supplied, then only the configuration policies that apply to repository are returned. If repository is not supplied, then all policies are returned.
query - String An (optional) search query that searches over the name property.
forDataRetention - Boolean If set to true, then only configuration policies with SCIP data retention enabled are returned. If set to false, then configuration policies with SCIP data retention enabled are filtered out.
forIndexing - Boolean If set to true, then only configuration policies with indexing enabled are returned. If set to false, then configuration policies with indexing enabled are filtered out.
forEmbeddings - Boolean If set to true, then only configuration policies with embeddings enabled are returned. If set to false, then configuration policies with embeddings enabled are filtered out.
protected - Boolean If set to true, then only protected configuration policies are returned. If set to false, then only un-protected configuration policies are returned. If unset, policies are returned regardless if they're protected or not.
first - Int When specified, indicates that this request should be paginated and the first N results (relative to the cursor) should be returned. i.e. how many results to return per page.
after - String

When specified, indicates that this request should be paginated and to fetch results starting at this cursor.

A future request can be made for more results by passing in the 'CodeIntelligenceConfigurationPolicyConnection.pageInfo.endCursor' that is returned.

Example

Query
query codeIntelligenceConfigurationPolicies(
  $repository: ID,
  $query: String,
  $forDataRetention: Boolean,
  $forIndexing: Boolean,
  $forEmbeddings: Boolean,
  $protected: Boolean,
  $first: Int,
  $after: String
) {
  codeIntelligenceConfigurationPolicies(
    repository: $repository,
    query: $query,
    forDataRetention: $forDataRetention,
    forIndexing: $forIndexing,
    forEmbeddings: $forEmbeddings,
    protected: $protected,
    first: $first,
    after: $after
  ) {
    nodes {
      ...CodeIntelligenceConfigurationPolicyFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "repository": 4,
  "query": "abc123",
  "forDataRetention": true,
  "forIndexing": true,
  "forEmbeddings": true,
  "protected": true,
  "first": 123,
  "after": "abc123"
}
Response
{
  "data": {
    "codeIntelligenceConfigurationPolicies": {
      "nodes": [CodeIntelligenceConfigurationPolicy],
      "totalCount": 987,
      "pageInfo": PageInfo
    }
  }
}

codeIntelligenceInferenceScript

Description

Return the currently set auto-indexing job inference script. Does not return the value stored in the environment variable or the default shipped scripts, only the value set via UI/GraphQL.

Response

Returns a String!

Example

Query
query codeIntelligenceInferenceScript {
  codeIntelligenceInferenceScript
}
Response
{
  "data": {
    "codeIntelligenceInferenceScript": "xyz789"
  }
}

codeownersIngestedFiles

Description

codeownersIngestedFiles returns all existing manually ingested codeowners files.

Arguments
Name Description
first - Int
after - Int

Example

Query
query codeownersIngestedFiles(
  $first: Int,
  $after: Int
) {
  codeownersIngestedFiles(
    first: $first,
    after: $after
  ) {
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
    nodes {
      ...CodeownersIngestedFileFragment
    }
  }
}
Variables
{"first": 123, "after": 123}
Response
{
  "data": {
    "codeownersIngestedFiles": {
      "totalCount": 123,
      "pageInfo": PageInfo,
      "nodes": [CodeownersIngestedFile]
    }
  }
}

completions

Description

Returns a string of completion responses

Response

Returns a String!

Arguments
Name Description
input - CompletionsInput!
fast - Boolean Default = false

Example

Query
query completions(
  $input: CompletionsInput!,
  $fast: Boolean
) {
  completions(
    input: $input,
    fast: $fast
  )
}
Variables
{"input": CompletionsInput, "fast": false}
Response
{"data": {"completions": "xyz789"}}

compute

Description

Computes valus from search results.

Response

Returns [ComputeResult!]!

Arguments
Name Description
query - String The search query. Default = ""

Example

Query
query compute($query: String) {
  compute(query: $query) {
    ... on ComputeMatchContext {
      ...ComputeMatchContextFragment
    }
    ... on ComputeText {
      ...ComputeTextFragment
    }
  }
}
Variables
{"query": ""}
Response
{"data": {"compute": [ComputeMatchContext]}}

currentUser

Description

The current user.

Response

Returns a User

Example

Query
query currentUser {
  currentUser {
    executorSecrets {
      ...ExecutorSecretConnectionFragment
    }
    id
    username
    email
    displayName
    avatarURL
    url
    settingsURL
    createdAt
    updatedAt
    siteAdmin
    builtinAuth
    latestSettings {
      ...SettingsFragment
    }
    settingsCascade {
      ...SettingsCascadeFragment
    }
    configurationCascade {
      ...ConfigurationCascadeFragment
    }
    organizations {
      ...OrgConnectionFragment
    }
    organizationMemberships {
      ...OrganizationMembershipConnectionFragment
    }
    tosAccepted
    usageStatistics {
      ...UserUsageStatisticsFragment
    }
    eventLogs {
      ...EventLogsConnectionFragment
    }
    emails {
      ...UserEmailFragment
    }
    hasVerifiedEmail
    completedPostSignup
    primaryEmail {
      ...UserEmailFragment
    }
    accessTokens {
      ...AccessTokenConnectionFragment
    }
    externalAccounts {
      ...ExternalAccountConnectionFragment
    }
    session {
      ...SessionFragment
    }
    viewerCanAdminister
    viewerCanChangeUsername
    surveyResponses {
      ...SurveyResponseFragment
    }
    databaseID
    namespaceName
    scimControlled
    roles {
      ...RoleConnectionFragment
    }
    permissions {
      ...PermissionConnectionFragment
    }
    completionsQuotaOverride
    codeCompletionsQuotaOverride
    codySubscription {
      ...CodySubscriptionFragment
    }
    codyProEnabled
    codyCurrentPeriodChatUsage
    codyCurrentPeriodCodeUsage
    codyCurrentPeriodChatLimit
    codyCurrentPeriodCodeLimit
    teams {
      ...TeamConnectionFragment
    }
    batchChanges {
      ...BatchChangeConnectionFragment
    }
    batchChangesCodeHosts {
      ...BatchChangesCodeHostConnectionFragment
    }
  }
}
Response
{
  "data": {
    "currentUser": {
      "executorSecrets": ExecutorSecretConnection,
      "id": "4",
      "username": "xyz789",
      "email": "abc123",
      "displayName": "abc123",
      "avatarURL": "abc123",
      "url": "abc123",
      "settingsURL": "abc123",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "siteAdmin": false,
      "builtinAuth": false,
      "latestSettings": Settings,
      "settingsCascade": SettingsCascade,
      "configurationCascade": ConfigurationCascade,
      "organizations": OrgConnection,
      "organizationMemberships": OrganizationMembershipConnection,
      "tosAccepted": false,
      "usageStatistics": UserUsageStatistics,
      "eventLogs": EventLogsConnection,
      "emails": [UserEmail],
      "hasVerifiedEmail": true,
      "completedPostSignup": true,
      "primaryEmail": UserEmail,
      "accessTokens": AccessTokenConnection,
      "externalAccounts": ExternalAccountConnection,
      "session": Session,
      "viewerCanAdminister": true,
      "viewerCanChangeUsername": true,
      "surveyResponses": [SurveyResponse],
      "databaseID": 987,
      "namespaceName": "abc123",
      "scimControlled": true,
      "roles": RoleConnection,
      "permissions": PermissionConnection,
      "completionsQuotaOverride": 987,
      "codeCompletionsQuotaOverride": 987,
      "codySubscription": CodySubscription,
      "codyProEnabled": true,
      "codyCurrentPeriodChatUsage": 987,
      "codyCurrentPeriodCodeUsage": 987,
      "codyCurrentPeriodChatLimit": 123,
      "codyCurrentPeriodCodeLimit": 987,
      "teams": TeamConnection,
      "batchChanges": BatchChangeConnection,
      "batchChangesCodeHosts": BatchChangesCodeHostConnection
    }
  }
}

defaultSearchContext

Description

Gets the default search context for the current user. This context is guaranteed to be available to the user.

Response

Returns a SearchContext

Example

Query
query defaultSearchContext {
  defaultSearchContext {
    id
    name
    namespace {
      ...NamespaceFragment
    }
    description
    spec
    autoDefined
    query
    repositories {
      ...SearchContextRepositoryRevisionsFragment
    }
    public
    updatedAt
    viewerCanManage
    viewerHasAsDefault
    viewerHasStarred
  }
}
Response
{
  "data": {
    "defaultSearchContext": {
      "id": "4",
      "name": "xyz789",
      "namespace": Namespace,
      "description": "xyz789",
      "spec": "abc123",
      "autoDefined": false,
      "query": "abc123",
      "repositories": [SearchContextRepositoryRevisions],
      "public": true,
      "updatedAt": "2007-12-03T10:15:30Z",
      "viewerCanManage": true,
      "viewerHasAsDefault": false,
      "viewerHasStarred": true
    }
  }
}

dotcom

Description

Queries that are only used on Sourcegraph.com.

FOR INTERNAL USE ONLY.

Response

Returns a DotcomQuery!

Example

Query
query dotcom {
  dotcom {
    productSubscription {
      ...ProductSubscriptionFragment
    }
    productSubscriptionByAccessToken {
      ...ProductSubscriptionFragment
    }
    productSubscriptions {
      ...ProductSubscriptionConnectionFragment
    }
    productLicenses {
      ...ProductLicenseConnectionFragment
    }
    codyGatewayDotcomUserByToken {
      ...CodyGatewayDotcomUserFragment
    }
  }
}
Response
{
  "data": {
    "dotcom": {
      "productSubscription": ProductSubscription,
      "productSubscriptionByAccessToken": ProductSubscription,
      "productSubscriptions": ProductSubscriptionConnection,
      "productLicenses": ProductLicenseConnection,
      "codyGatewayDotcomUserByToken": CodyGatewayDotcomUser
    }
  }
}

embeddingsMultiSearch

use getCodyContext instead.
Description

Experimental: Searches a set of repositories for similar code and text results using embeddings. We separated code and text results because text results tended to always feature at the top of the combined results, and didn't leave room for the code.

Response

Returns an EmbeddingsSearchResults!

Arguments
Name Description
repos - [ID!]! The repository to search.
query - String! The query used for embeddings search.
codeResultsCount - Int! The number of code results to return.
textResultsCount - Int! The number of text results to return. Text results contain Markdown files and similar file types primarily used for writing documentation.

Example

Query
query embeddingsMultiSearch(
  $repos: [ID!]!,
  $query: String!,
  $codeResultsCount: Int!,
  $textResultsCount: Int!
) {
  embeddingsMultiSearch(
    repos: $repos,
    query: $query,
    codeResultsCount: $codeResultsCount,
    textResultsCount: $textResultsCount
  ) {
    codeResults {
      ...EmbeddingsSearchResultFragment
    }
    textResults {
      ...EmbeddingsSearchResultFragment
    }
  }
}
Variables
{
  "repos": [4],
  "query": "abc123",
  "codeResultsCount": 123,
  "textResultsCount": 987
}
Response
{
  "data": {
    "embeddingsMultiSearch": {
      "codeResults": [EmbeddingsSearchResult],
      "textResults": [EmbeddingsSearchResult]
    }
  }
}

embeddingsSearch

use getCodyContext instead.
Description

Experimental: Searches a repository for similar code and text results using embeddings. We separated code and text results because text results tended to always feature at the top of the combined results, and didn't leave room for the code.

Response

Returns an EmbeddingsSearchResults!

Arguments
Name Description
repo - ID! The repository to search.
query - String! The query used for embeddings search.
codeResultsCount - Int! The number of code results to return.
textResultsCount - Int! The number of text results to return. Text results contain Markdown files and similar file types primarily used for writing documentation.

Example

Query
query embeddingsSearch(
  $repo: ID!,
  $query: String!,
  $codeResultsCount: Int!,
  $textResultsCount: Int!
) {
  embeddingsSearch(
    repo: $repo,
    query: $query,
    codeResultsCount: $codeResultsCount,
    textResultsCount: $textResultsCount
  ) {
    codeResults {
      ...EmbeddingsSearchResultFragment
    }
    textResults {
      ...EmbeddingsSearchResultFragment
    }
  }
}
Variables
{
  "repo": "4",
  "query": "xyz789",
  "codeResultsCount": 123,
  "textResultsCount": 987
}
Response
{
  "data": {
    "embeddingsSearch": {
      "codeResults": [EmbeddingsSearchResult],
      "textResults": [EmbeddingsSearchResult]
    }
  }
}

enterpriseLicenseHasFeature

Description

Checks whether the given feature is enabled on Sourcegraph.

Response

Returns a Boolean!

Arguments
Name Description
feature - String!

Example

Query
query enterpriseLicenseHasFeature($feature: String!) {
  enterpriseLicenseHasFeature(feature: $feature)
}
Variables
{"feature": "abc123"}
Response
{"data": {"enterpriseLicenseHasFeature": true}}

evaluateFeatureFlag

Description

Evaluates a feature flag for the current user Returns null if feature flag does not exist

Response

Returns a Boolean

Arguments
Name Description
flagName - String!

Example

Query
query evaluateFeatureFlag($flagName: String!) {
  evaluateFeatureFlag(flagName: $flagName)
}
Variables
{"flagName": "abc123"}
Response
{"data": {"evaluateFeatureFlag": true}}

evaluatedFeatureFlags

Description

Retrieve all evaluated feature flags for the current user

Response

Returns [EvaluatedFeatureFlag!]!

Example

Query
query evaluatedFeatureFlags {
  evaluatedFeatureFlags {
    name
    value
  }
}
Response
{
  "data": {
    "evaluatedFeatureFlags": [
      {"name": "abc123", "value": false}
    ]
  }
}

executorSecrets

Description

The list of all globally available executor secrets.

Response

Returns an ExecutorSecretConnection!

Arguments
Name Description
scope - ExecutorSecretScope! The scope for which secrets shall be returned.
first - Int Only return N records. Default = 50
after - String Opaque cursor for pagination.

Example

Query
query executorSecrets(
  $scope: ExecutorSecretScope!,
  $first: Int,
  $after: String
) {
  executorSecrets(
    scope: $scope,
    first: $first,
    after: $after
  ) {
    nodes {
      ...ExecutorSecretFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "scope": "BATCHES",
  "first": 50,
  "after": "abc123"
}
Response
{
  "data": {
    "executorSecrets": {
      "nodes": [ExecutorSecret],
      "totalCount": 123,
      "pageInfo": PageInfo
    }
  }
}

executors

Description

Retrieve active executor compute instances.

Response

Returns an ExecutorConnection!

Arguments
Name Description
query - String An (optional) search query that searches over the hostname, queue name, os, architecture, and version properties.
active - Boolean Whether to show only executors that have sent a heartbeat in the last fifteen minutes.
first - Int Returns the first n executors. Default = 50
after - String Opaque pagination cursor.

Example

Query
query executors(
  $query: String,
  $active: Boolean,
  $first: Int,
  $after: String
) {
  executors(
    query: $query,
    active: $active,
    first: $first,
    after: $after
  ) {
    nodes {
      ...ExecutorFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "query": "abc123",
  "active": false,
  "first": 50,
  "after": "xyz789"
}
Response
{
  "data": {
    "executors": {
      "nodes": [Executor],
      "totalCount": 987,
      "pageInfo": PageInfo
    }
  }
}

externalServiceNamespaces

Description

Lists all namespaces for a given external service connection. A namespace is an entity on the code host that repositories are assignable to.

Arguments
Name Description
id - ID The GraphQL ID of the external service whose configuration will be used to define the code host remote url to submit requests to and the token value to authenticate with. If no external service exists which provides the necessary request parameters then leave ID nil and provide kind, remote code host token and url.
kind - ExternalServiceKind! The kind of the external service.
token - String! The secret token value that is used to authenticate.
url - String! The url of the external service.

Example

Query
query externalServiceNamespaces(
  $id: ID,
  $kind: ExternalServiceKind!,
  $token: String!,
  $url: String!
) {
  externalServiceNamespaces(
    id: $id,
    kind: $kind,
    token: $token,
    url: $url
  ) {
    nodes {
      ...ExternalServiceNamespaceFragment
    }
    totalCount
  }
}
Variables
{
  "id": "4",
  "kind": "AWSCODECOMMIT",
  "token": "abc123",
  "url": "abc123"
}
Response
{
  "data": {
    "externalServiceNamespaces": {
      "nodes": [ExternalServiceNamespace],
      "totalCount": 123
    }
  }
}

externalServiceRepositories

Description

Lists all repositories for a given external service connection.

Arguments
Name Description
id - ID The GraphQL ID of the external service whose configuration will be used to define the code host remote url to submit requests to and the token value to authenticate with. If no external service exists which provides the necessary request parameters then leave ID nil and provide kind, remote code host token and url.
kind - ExternalServiceKind! The kind of the external service.
token - String! The secret token value that is used to authenticate.
url - String! The url of the external service.
query - String! Repository query string.
excludeRepos - [String!]! A list of repository names to exclude from results (in the form of owner/name).
first - Int Returns the first n repositories matching the query and excludeRepos criteria.

Example

Query
query externalServiceRepositories(
  $id: ID,
  $kind: ExternalServiceKind!,
  $token: String!,
  $url: String!,
  $query: String!,
  $excludeRepos: [String!]!,
  $first: Int
) {
  externalServiceRepositories(
    id: $id,
    kind: $kind,
    token: $token,
    url: $url,
    query: $query,
    excludeRepos: $excludeRepos,
    first: $first
  ) {
    nodes {
      ...ExternalServiceRepositoryFragment
    }
  }
}
Variables
{
  "id": 4,
  "kind": "AWSCODECOMMIT",
  "token": "abc123",
  "url": "xyz789",
  "query": "abc123",
  "excludeRepos": ["abc123"],
  "first": 987
}
Response
{
  "data": {
    "externalServiceRepositories": {
      "nodes": [ExternalServiceRepository]
    }
  }
}

externalServices

Description

Lists external services under given namespace. If no namespace is given, it returns all external services.

Response

Returns an ExternalServiceConnection!

Arguments
Name Description
first - Int Returns the first n external services from the list.
after - String Opaque pagination cursor.
repo - ID If provided, fetch external services which contain a repo with the given ID.

Example

Query
query externalServices(
  $first: Int,
  $after: String,
  $repo: ID
) {
  externalServices(
    first: $first,
    after: $after,
    repo: $repo
  ) {
    nodes {
      ...ExternalServiceFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{"first": 987, "after": "xyz789", "repo": 4}
Response
{
  "data": {
    "externalServices": {
      "nodes": [ExternalService],
      "totalCount": 123,
      "pageInfo": PageInfo
    }
  }
}

featureFlag

Description

Retrieve a feature flag

Response

Returns a FeatureFlag!

Arguments
Name Description
name - String!

Example

Query
query featureFlag($name: String!) {
  featureFlag(name: $name) {
    ... on FeatureFlagBoolean {
      ...FeatureFlagBooleanFragment
    }
    ... on FeatureFlagRollout {
      ...FeatureFlagRolloutFragment
    }
  }
}
Variables
{"name": "abc123"}
Response
{"data": {"featureFlag": FeatureFlagBoolean}}

featureFlags

Description

Retrieve the list of defined feature flags

Response

Returns [FeatureFlag!]!

Example

Query
query featureFlags {
  featureFlags {
    ... on FeatureFlagBoolean {
      ...FeatureFlagBooleanFragment
    }
    ... on FeatureFlagRollout {
      ...FeatureFlagRolloutFragment
    }
  }
}
Response
{"data": {"featureFlags": [FeatureFlagBoolean]}}

getChangesetsByIDs

Description

Get all changesets in the given batch change by ID.

Response

Returns a ChangesetConnection!

Arguments
Name Description
batchChange - ID!
changesets - [ID!]!

Example

Query
query getChangesetsByIDs(
  $batchChange: ID!,
  $changesets: [ID!]!
) {
  getChangesetsByIDs(
    batchChange: $batchChange,
    changesets: $changesets
  ) {
    nodes {
      ...ChangesetFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{"batchChange": "4", "changesets": [4]}
Response
{
  "data": {
    "getChangesetsByIDs": {
      "nodes": [Changeset],
      "totalCount": 123,
      "pageInfo": PageInfo
    }
  }
}

getCodyContext

Description

EXPERIMENTAL: Get pieces of context related to the query from a set of repositories.

Response

Returns [CodyContextResult!]!

Arguments
Name Description
repos - [ID!]! The repositories to search.
query - String! A natural language query string.
codeResultsCount - Int! The number of code results to return.
textResultsCount - Int! The number of text results to return. Text results contain Markdown files and similar file types primarily used for writing documentation.

Example

Query
query getCodyContext(
  $repos: [ID!]!,
  $query: String!,
  $codeResultsCount: Int!,
  $textResultsCount: Int!
) {
  getCodyContext(
    repos: $repos,
    query: $query,
    codeResultsCount: $codeResultsCount,
    textResultsCount: $textResultsCount
  ) {
    ... on FileChunkContext {
      ...FileChunkContextFragment
    }
  }
}
Variables
{
  "repos": ["4"],
  "query": "xyz789",
  "codeResultsCount": 987,
  "textResultsCount": 987
}
Response
{"data": {"getCodyContext": [FileChunkContext]}}

gitHubApp

Description

Looks up a GitHub App by its ID.

Response

Returns a GitHubApp

Arguments
Name Description
id - ID!

Example

Query
query gitHubApp($id: ID!) {
  gitHubApp(id: $id) {
    id
    appID
    name
    domain
    slug
    baseURL
    appURL
    clientID
    clientSecret
    logo
    createdAt
    updatedAt
    installations {
      ...InstallationFragment
    }
    webhook {
      ...WebhookFragment
    }
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "gitHubApp": {
      "id": 4,
      "appID": 123,
      "name": "xyz789",
      "domain": "xyz789",
      "slug": "abc123",
      "baseURL": "abc123",
      "appURL": "xyz789",
      "clientID": "xyz789",
      "clientSecret": "abc123",
      "logo": "abc123",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "installations": [Installation],
      "webhook": Webhook
    }
  }
}

gitHubAppByAppID

Description

Looks up a GitHub App by its AppID and BaseURL.

Response

Returns a GitHubApp

Arguments
Name Description
appID - Int!
baseURL - String!

Example

Query
query gitHubAppByAppID(
  $appID: Int!,
  $baseURL: String!
) {
  gitHubAppByAppID(
    appID: $appID,
    baseURL: $baseURL
  ) {
    id
    appID
    name
    domain
    slug
    baseURL
    appURL
    clientID
    clientSecret
    logo
    createdAt
    updatedAt
    installations {
      ...InstallationFragment
    }
    webhook {
      ...WebhookFragment
    }
  }
}
Variables
{"appID": 123, "baseURL": "abc123"}
Response
{
  "data": {
    "gitHubAppByAppID": {
      "id": "4",
      "appID": 123,
      "name": "xyz789",
      "domain": "abc123",
      "slug": "abc123",
      "baseURL": "abc123",
      "appURL": "xyz789",
      "clientID": "abc123",
      "clientSecret": "xyz789",
      "logo": "xyz789",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "installations": [Installation],
      "webhook": Webhook
    }
  }
}

gitHubApps

Description

All configured GitHub Apps, optionally filtered by the domain in which they are used.

Response

Returns a GitHubAppConnection!

Arguments
Name Description
domain - GitHubAppDomain

Example

Query
query gitHubApps($domain: GitHubAppDomain) {
  gitHubApps(domain: $domain) {
    nodes {
      ...GitHubAppFragment
    }
    totalCount
  }
}
Variables
{"domain": "REPOS"}
Response
{
  "data": {
    "gitHubApps": {
      "nodes": [GitHubApp],
      "totalCount": 123
    }
  }
}

gitservers

Description

Returns information pertaining to all gitserver instances associated with this Sourcegraph instance.

Site-admin only.

Response

Returns a GitserverInstanceConnection!

Example

Query
query gitservers {
  gitservers {
    nodes {
      ...GitserverInstanceFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Response
{
  "data": {
    "gitservers": {
      "nodes": [GitserverInstance],
      "totalCount": 987,
      "pageInfo": PageInfo
    }
  }
}

globalChangesetsStats

Description

Stats on all the changesets across the instance for Batch Changes.

Response

Returns a GlobalChangesetsStats!

Example

Query
query globalChangesetsStats {
  globalChangesetsStats {
    unpublished
    draft
    open
    merged
    closed
    total
  }
}
Response
{
  "data": {
    "globalChangesetsStats": {
      "unpublished": 987,
      "draft": 123,
      "open": 987,
      "merged": 987,
      "closed": 123,
      "total": 123
    }
  }
}

highlightCode

Description

EXPERIMENTAL: Syntax highlights a code string.

Response

Returns a String!

Arguments
Name Description
code - String!
fuzzyLanguage - String!
disableTimeout - Boolean!

Example

Query
query highlightCode(
  $code: String!,
  $fuzzyLanguage: String!,
  $disableTimeout: Boolean!
) {
  highlightCode(
    code: $code,
    fuzzyLanguage: $fuzzyLanguage,
    disableTimeout: $disableTimeout
  )
}
Variables
{
  "code": "xyz789",
  "fuzzyLanguage": "xyz789",
  "disableTimeout": false
}
Response
{"data": {"highlightCode": "xyz789"}}

indexerKeys

Description

A list of unique indexer keys queryable via the preciseIndexes.indexerKey filter.

Response

Returns [String!]!

Arguments
Name Description
repo - ID If supplied, only indexers associated with the given repository will be returned.

Example

Query
query indexerKeys($repo: ID) {
  indexerKeys(repo: $repo)
}
Variables
{"repo": "4"}
Response
{"data": {"indexerKeys": ["abc123"]}}

inferAutoIndexJobsForRepo

Description

Return (but do not enqueue) descriptions of auto indexing jobs at the current revision.

Response

Returns an InferAutoIndexJobsResult!

Arguments
Name Description
repository - ID!
rev - String
script - String

Example

Query
query inferAutoIndexJobsForRepo(
  $repository: ID!,
  $rev: String,
  $script: String
) {
  inferAutoIndexJobsForRepo(
    repository: $repository,
    rev: $rev,
    script: $script
  ) {
    jobs {
      ...AutoIndexJobDescriptionFragment
    }
    inferenceOutput
  }
}
Variables
{
  "repository": 4,
  "rev": "xyz789",
  "script": "abc123"
}
Response
{
  "data": {
    "inferAutoIndexJobsForRepo": {
      "jobs": [AutoIndexJobDescription],
      "inferenceOutput": "xyz789"
    }
  }
}

insightAdminBackfillQueue

Description

Fetch information related to the queue of backfilling insights.

Arguments
Name Description
first - Int Returns the first n queue items from the list.
last - Int Returns the last n queue items from the list.
after - String An opaque cursor that is used for pagination.
before - String An opaque cursor that is used for pagination.
orderBy - BackfillQueueOrderBy How to order the list. Default = STATE
descending - Boolean Sort direction. Default = false
states - [InsightQueueItemState!] List of states to filter list by.
textSearch - String Text to filter the list, checking the Insight Title and Series Label

Example

Query
query insightAdminBackfillQueue(
  $first: Int,
  $last: Int,
  $after: String,
  $before: String,
  $orderBy: BackfillQueueOrderBy,
  $descending: Boolean,
  $states: [InsightQueueItemState!],
  $textSearch: String
) {
  insightAdminBackfillQueue(
    first: $first,
    last: $last,
    after: $after,
    before: $before,
    orderBy: $orderBy,
    descending: $descending,
    states: $states,
    textSearch: $textSearch
  ) {
    nodes {
      ...InsightBackfillQueueItemFragment
    }
    totalCount
    pageInfo {
      ...ConnectionPageInfoFragment
    }
  }
}
Variables
{
  "first": 987,
  "last": 987,
  "after": "xyz789",
  "before": "xyz789",
  "orderBy": "STATE",
  "descending": false,
  "states": ["NEW"],
  "textSearch": "xyz789"
}
Response
{
  "data": {
    "insightAdminBackfillQueue": {
      "nodes": [InsightBackfillQueueItem],
      "totalCount": 123,
      "pageInfo": ConnectionPageInfo
    }
  }
}

insightSeriesQueryStatus

Description

Retrieve information about queued insights series and their breakout by status. Restricted to admins only.

Response

Returns [InsightSeriesQueryStatus!]!

Example

Query
query insightSeriesQueryStatus {
  insightSeriesQueryStatus {
    seriesId
    query
    enabled
    errored
    completed
    processing
    failed
    queued
  }
}
Response
{
  "data": {
    "insightSeriesQueryStatus": [
      {
        "seriesId": "xyz789",
        "query": "abc123",
        "enabled": false,
        "errored": 123,
        "completed": 123,
        "processing": 123,
        "failed": 123,
        "queued": 123
      }
    ]
  }
}

insightViewDebug

Description

Retrieve information about an insight view and its status. Restricted to admins only.

Response

Returns an InsightViewDebug

Arguments
Name Description
id - ID!

Example

Query
query insightViewDebug($id: ID!) {
  insightViewDebug(id: $id) {
    raw
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "insightViewDebug": {"raw": ["abc123"]}
  }
}

insightViews

Description

Return all insight views visible to the authenticated user.

Response

Returns an InsightViewConnection!

Arguments
Name Description
first - Int
after - String
id - ID
excludeIds - [ID!] Allow you to exclude subset of insights by their ids.
find - String Allow you to search insight views by their title or data series labels.
isFrozen - Boolean
filters - InsightViewFiltersInput
seriesDisplayOptions - SeriesDisplayOptionsInput

Example

Query
query insightViews(
  $first: Int,
  $after: String,
  $id: ID,
  $excludeIds: [ID!],
  $find: String,
  $isFrozen: Boolean,
  $filters: InsightViewFiltersInput,
  $seriesDisplayOptions: SeriesDisplayOptionsInput
) {
  insightViews(
    first: $first,
    after: $after,
    id: $id,
    excludeIds: $excludeIds,
    find: $find,
    isFrozen: $isFrozen,
    filters: $filters,
    seriesDisplayOptions: $seriesDisplayOptions
  ) {
    nodes {
      ...InsightViewFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
    totalCount
  }
}
Variables
{
  "first": 123,
  "after": "xyz789",
  "id": "4",
  "excludeIds": [4],
  "find": "xyz789",
  "isFrozen": true,
  "filters": InsightViewFiltersInput,
  "seriesDisplayOptions": SeriesDisplayOptionsInput
}
Response
{
  "data": {
    "insightViews": {
      "nodes": [InsightView],
      "pageInfo": PageInfo,
      "totalCount": 123
    }
  }
}

insightsDashboards

Description

Return dashboards visible to the authenticated user.

Response

Returns an InsightsDashboardConnection!

Arguments
Name Description
first - Int
after - String
id - ID

Example

Query
query insightsDashboards(
  $first: Int,
  $after: String,
  $id: ID
) {
  insightsDashboards(
    first: $first,
    after: $after,
    id: $id
  ) {
    nodes {
      ...InsightsDashboardFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "first": 123,
  "after": "xyz789",
  "id": "4"
}
Response
{
  "data": {
    "insightsDashboards": {
      "nodes": [InsightsDashboard],
      "pageInfo": PageInfo
    }
  }
}

instanceOwnershipStats

Description

Returns ownership stats for the whole Sourcegraph instance

Response

Returns an OwnershipStats!

Example

Query
query instanceOwnershipStats {
  instanceOwnershipStats {
    totalFiles
    totalCodeownedFiles
    totalOwnedFiles
    totalAssignedOwnershipFiles
    updatedAt
  }
}
Response
{
  "data": {
    "instanceOwnershipStats": {
      "totalFiles": 123,
      "totalCodeownedFiles": 987,
      "totalOwnedFiles": 987,
      "totalAssignedOwnershipFiles": 123,
      "updatedAt": "2007-12-03T10:15:30Z"
    }
  }
}

invitationByToken

Description

EXPERIMENTAL: Get invitation based on the JWT in the invitation URL

Response

Returns an OrganizationInvitation!

Arguments
Name Description
token - String! The token that uniquely identifies the invitation

Example

Query
query invitationByToken($token: String!) {
  invitationByToken(token: $token) {
    id
    organization {
      ...OrgFragment
    }
    sender {
      ...UserFragment
    }
    recipient {
      ...UserFragment
    }
    recipientEmail
    createdAt
    notifiedAt
    respondedAt
    responseType
    respondURL
    revokedAt
    expiresAt
    isVerifiedEmail
  }
}
Variables
{"token": "abc123"}
Response
{
  "data": {
    "invitationByToken": {
      "id": "4",
      "organization": Org,
      "sender": User,
      "recipient": User,
      "recipientEmail": "abc123",
      "createdAt": "2007-12-03T10:15:30Z",
      "notifiedAt": "2007-12-03T10:15:30Z",
      "respondedAt": "2007-12-03T10:15:30Z",
      "responseType": "ACCEPT",
      "respondURL": "abc123",
      "revokedAt": "2007-12-03T10:15:30Z",
      "expiresAt": "2007-12-03T10:15:30Z",
      "isVerifiedEmail": false
    }
  }
}

isContextRequiredForChatQuery

Description

Experimental: Determines whether the given query requires further context before it can be answered. For example:

  • "What are Sourcegraph Notebooks" requires additional information from the Sourcegraph repository (Notebooks Markdown docs, etc.).
  • "Translate the previous code to Typescript" does not need additional context since it is referring to the existing context (or conversation).
Response

Returns a Boolean!

Arguments
Name Description
query - String!

Example

Query
query isContextRequiredForChatQuery($query: String!) {
  isContextRequiredForChatQuery(query: $query)
}
Variables
{"query": "abc123"}
Response
{"data": {"isContextRequiredForChatQuery": true}}

isSearchContextAvailable

Description

Determines whether the search context is within the set of search contexts available to the current user. The set consists of contexts created by the user, contexts created by the users' organizations, and instance-level contexts.

Response

Returns a Boolean!

Arguments
Name Description
spec - String!

Example

Query
query isSearchContextAvailable($spec: String!) {
  isSearchContextAvailable(spec: $spec)
}
Variables
{"spec": "abc123"}
Response
{"data": {"isSearchContextAvailable": true}}

maxUnlicensedChangesets

Description

Returns the max number of changesets are allowed for License that does not have the batch change feature.

Response

Returns an Int!

Example

Query
query maxUnlicensedChangesets {
  maxUnlicensedChangesets
}
Response
{"data": {"maxUnlicensedChangesets": 987}}

namespace

Description

Look up a namespace by ID.

Response

Returns a Namespace

Arguments
Name Description
id - ID!

Example

Query
query namespace($id: ID!) {
  namespace(id: $id) {
    id
    namespaceName
    url
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "namespace": {
      "id": 4,
      "namespaceName": "abc123",
      "url": "xyz789"
    }
  }
}

namespaceByName

Description

Look up a namespace by name, which is a username or organization name.

Response

Returns a Namespace

Arguments
Name Description
name - String! The name of the namespace.

Example

Query
query namespaceByName($name: String!) {
  namespaceByName(name: $name) {
    id
    namespaceName
    url
  }
}
Variables
{"name": "xyz789"}
Response
{
  "data": {
    "namespaceByName": {
      "id": "4",
      "namespaceName": "xyz789",
      "url": "abc123"
    }
  }
}

node

Description

Looks up a node by ID.

Response

Returns a Node

Arguments
Name Description
id - ID!

Example

Query
query node($id: ID!) {
  node(id: $id) {
    id
  }
}
Variables
{"id": "4"}
Response
{"data": {"node": {"id": 4}}}

notebooks

Description

All available notebooks.

Response

Returns a NotebookConnection!

Arguments
Name Description
first - Int Returns the first n notebooks from the list. Default = 50
after - String Opaque pagination cursor.
query - String Query to filter notebooks by title and blocks content.
creatorUserID - ID Filter to notebooks made by a single creator.
starredByUserID - ID Filter to notebooks that were starred by the user.
namespace - ID Filter to notebooks associated with a specific namespace (user or org).
orderBy - NotebooksOrderBy Sort field. Default = NOTEBOOK_UPDATED_AT
descending - Boolean Sort direction. Default = false

Example

Query
query notebooks(
  $first: Int,
  $after: String,
  $query: String,
  $creatorUserID: ID,
  $starredByUserID: ID,
  $namespace: ID,
  $orderBy: NotebooksOrderBy,
  $descending: Boolean
) {
  notebooks(
    first: $first,
    after: $after,
    query: $query,
    creatorUserID: $creatorUserID,
    starredByUserID: $starredByUserID,
    namespace: $namespace,
    orderBy: $orderBy,
    descending: $descending
  ) {
    nodes {
      ...NotebookFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "first": 50,
  "after": "abc123",
  "query": "abc123",
  "creatorUserID": 4,
  "starredByUserID": 4,
  "namespace": "4",
  "orderBy": "NOTEBOOK_UPDATED_AT",
  "descending": false
}
Response
{
  "data": {
    "notebooks": {
      "nodes": [Notebook],
      "totalCount": 987,
      "pageInfo": PageInfo
    }
  }
}

onboardingTourContent

Description

(experimental) Returns onboarding tour content.

Response

Returns an OnboardingTour!

Example

Query
query onboardingTourContent {
  onboardingTourContent {
    current {
      ...OnboardingTourContentFragment
    }
  }
}
Response
{
  "data": {
    "onboardingTourContent": {
      "current": OnboardingTourContent
    }
  }
}

orgMembersSummary

Description

Get started organization summary

Response

Returns an OrgMembersSummary!

Arguments
Name Description
organization - ID! The organization ID

Example

Query
query orgMembersSummary($organization: ID!) {
  orgMembersSummary(organization: $organization) {
    id
    membersCount
    invitesCount
  }
}
Variables
{"organization": "4"}
Response
{
  "data": {
    "orgMembersSummary": {"id": 4, "membersCount": 123, "invitesCount": 123}
  }
}

organization

Description

Looks up an organization by name.

Response

Returns an Org

Arguments
Name Description
name - String!

Example

Query
query organization($name: String!) {
  organization(name: $name) {
    executorSecrets {
      ...ExecutorSecretConnectionFragment
    }
    id
    name
    displayName
    createdAt
    members {
      ...NewUsersConnectionFragment
    }
    latestSettings {
      ...SettingsFragment
    }
    settingsCascade {
      ...SettingsCascadeFragment
    }
    configurationCascade {
      ...ConfigurationCascadeFragment
    }
    viewerPendingInvitation {
      ...OrganizationInvitationFragment
    }
    viewerCanAdminister
    viewerIsMember
    url
    settingsURL
    namespaceName
    batchChanges {
      ...BatchChangeConnectionFragment
    }
  }
}
Variables
{"name": "abc123"}
Response
{
  "data": {
    "organization": {
      "executorSecrets": ExecutorSecretConnection,
      "id": 4,
      "name": "xyz789",
      "displayName": "xyz789",
      "createdAt": "2007-12-03T10:15:30Z",
      "members": NewUsersConnection,
      "latestSettings": Settings,
      "settingsCascade": SettingsCascade,
      "configurationCascade": ConfigurationCascade,
      "viewerPendingInvitation": OrganizationInvitation,
      "viewerCanAdminister": false,
      "viewerIsMember": false,
      "url": "abc123",
      "settingsURL": "xyz789",
      "namespaceName": "xyz789",
      "batchChanges": BatchChangeConnection
    }
  }
}

organizationFeatureFlagOverrides

Description

Retrieve all organization feature flag overrides for the current user

Response

Returns [FeatureFlagOverride!]!

Example

Query
query organizationFeatureFlagOverrides {
  organizationFeatureFlagOverrides {
    id
    namespace {
      ...NamespaceFragment
    }
    targetFlag {
      ... on FeatureFlagBoolean {
        ...FeatureFlagBooleanFragment
      }
      ... on FeatureFlagRollout {
        ...FeatureFlagRolloutFragment
      }
    }
    value
  }
}
Response
{
  "data": {
    "organizationFeatureFlagOverrides": [
      {
        "id": "4",
        "namespace": Namespace,
        "targetFlag": FeatureFlagBoolean,
        "value": true
      }
    ]
  }
}

organizationFeatureFlagValue

Description

Retrieve the value of a feature flag for the organization

Response

Returns a Boolean!

Arguments
Name Description
orgID - ID!
flagName - String!

Example

Query
query organizationFeatureFlagValue(
  $orgID: ID!,
  $flagName: String!
) {
  organizationFeatureFlagValue(
    orgID: $orgID,
    flagName: $flagName
  )
}
Variables
{"orgID": 4, "flagName": "abc123"}
Response
{"data": {"organizationFeatureFlagValue": true}}

organizations

Description

List all organizations.

Response

Returns an OrgConnection!

Arguments
Name Description
first - Int Returns the first n organizations from the list.
query - String Return organizations whose names or display names match the query.

Example

Query
query organizations(
  $first: Int,
  $query: String
) {
  organizations(
    first: $first,
    query: $query
  ) {
    nodes {
      ...OrgFragment
    }
    totalCount
  }
}
Variables
{"first": 987, "query": "abc123"}
Response
{
  "data": {
    "organizations": {"nodes": [Org], "totalCount": 987}
  }
}

outOfBandMigrations

Description

Retrieve all registered out-of-band migrations.

Response

Returns [OutOfBandMigration!]!

Example

Query
query outOfBandMigrations {
  outOfBandMigrations {
    id
    team
    component
    description
    introduced
    deprecated
    progress
    created
    lastUpdated
    nonDestructive
    applyReverse
    errors {
      ...OutOfBandMigrationErrorFragment
    }
  }
}
Response
{
  "data": {
    "outOfBandMigrations": [
      {
        "id": 4,
        "team": "abc123",
        "component": "xyz789",
        "description": "xyz789",
        "introduced": "xyz789",
        "deprecated": "xyz789",
        "progress": 987.65,
        "created": "2007-12-03T10:15:30Z",
        "lastUpdated": "2007-12-03T10:15:30Z",
        "nonDestructive": true,
        "applyReverse": true,
        "errors": [OutOfBandMigrationError]
      }
    ]
  }
}

outboundRequests

Description

Get a log of the latest outbound external requests. Only available to site admins.

Response

Returns an OutboundRequestConnection!

Arguments
Name Description
first - Int Returns the first n log items. If omitted then it returns all of them.
after - String Opaque pagination cursor.

Example

Query
query outboundRequests(
  $first: Int,
  $after: String
) {
  outboundRequests(
    first: $first,
    after: $after
  ) {
    nodes {
      ...OutboundRequestFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{"first": 987, "after": "xyz789"}
Response
{
  "data": {
    "outboundRequests": {
      "nodes": [OutboundRequest],
      "totalCount": 987,
      "pageInfo": PageInfo
    }
  }
}

outboundWebhookEventTypes

Description

Returns all possible outbound webhook event types.

Only site admins have access to this query.

Response

Returns [OutboundWebhookEventType!]!

Example

Query
query outboundWebhookEventTypes {
  outboundWebhookEventTypes {
    key
    description
  }
}
Response
{
  "data": {
    "outboundWebhookEventTypes": [
      {
        "key": "abc123",
        "description": "abc123"
      }
    ]
  }
}

outboundWebhooks

Description

Returns the outbound webhooks registered within Sourcegraph, optionally filtered by event type and scope. To filter by scope, event type is also required. If the event type and scope are both omitted, all webhooks are returned.

Only site admins have access to this query.

Response

Returns an OutboundWebhookConnection!

Arguments
Name Description
first - Int Default = 50
after - String
eventType - String
scope - String

Example

Query
query outboundWebhooks(
  $first: Int,
  $after: String,
  $eventType: String,
  $scope: String
) {
  outboundWebhooks(
    first: $first,
    after: $after,
    eventType: $eventType,
    scope: $scope
  ) {
    nodes {
      ...OutboundWebhookFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "first": 50,
  "after": "abc123",
  "eventType": "xyz789",
  "scope": "abc123"
}
Response
{
  "data": {
    "outboundWebhooks": {
      "nodes": [OutboundWebhook],
      "totalCount": 123,
      "pageInfo": PageInfo
    }
  }
}

ownSignalConfigurations

Description

List all ownership signal configurations

Response

Returns [OwnSignalConfiguration!]!

Example

Query
query ownSignalConfigurations {
  ownSignalConfigurations {
    name
    description
    isEnabled
    excludedRepoPatterns
  }
}
Response
{
  "data": {
    "ownSignalConfigurations": [
      {
        "name": "abc123",
        "description": "xyz789",
        "isEnabled": false,
        "excludedRepoPatterns": ["abc123"]
      }
    ]
  }
}

packageRepoFilters

Description

Query package repo reference filters.

Response

Returns [PackageFilter!]

Arguments
Name Description
behaviour - PackageMatchBehaviour Whether the matcher should be for allowlisting or blocklisting.
kind - PackageRepoReferenceKind The ecosystem of the package repo reference this matcher should apply to. Maps to the external service whos config would be updated when used in the set query.

Example

Query
query packageRepoFilters(
  $behaviour: PackageMatchBehaviour,
  $kind: PackageRepoReferenceKind
) {
  packageRepoFilters(
    behaviour: $behaviour,
    kind: $kind
  ) {
    id
    behaviour
    kind
    nameFilter {
      ...PackageNameFilterFragment
    }
    versionFilter {
      ...PackageVersionFilterFragment
    }
  }
}
Variables
{"behaviour": "BLOCK", "kind": "GOMODULES"}
Response
{
  "data": {
    "packageRepoFilters": [
      {
        "id": 4,
        "behaviour": "BLOCK",
        "kind": "GOMODULES",
        "nameFilter": PackageNameFilter,
        "versionFilter": PackageVersionFilter
      }
    ]
  }
}

packageRepoReferences

Description

Query package repo references.

Response

Returns a PackageRepoReferenceConnection!

Arguments
Name Description
kind - PackageRepoReferenceKind The exact package repo reference kind to filter by.
name - String If supplied, only package repo references that match the given terms by their name will be returned. TODO: fuzzy vs exact?
first - Int Returns the first n package repo references from the list.
after - String Opaque pagination cursor.

Example

Query
query packageRepoReferences(
  $kind: PackageRepoReferenceKind,
  $name: String,
  $first: Int,
  $after: String
) {
  packageRepoReferences(
    kind: $kind,
    name: $name,
    first: $first,
    after: $after
  ) {
    nodes {
      ...PackageRepoReferenceFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "kind": "GOMODULES",
  "name": "abc123",
  "first": 123,
  "after": "abc123"
}
Response
{
  "data": {
    "packageRepoReferences": {
      "nodes": [PackageRepoReference],
      "totalCount": 123,
      "pageInfo": PageInfo
    }
  }
}

packageRepoReferencesMatchingFilter

Description

Returns either a list of package repo references, or the versions of a single package repo reference, that match the provided matcher.

Response

Returns a PackageRepoOrVersionConnection!

Arguments
Name Description
kind - PackageRepoReferenceKind! The kind of the package repo reference this matcher should apply to.
filter - PackageVersionOrNameFilterInput! The matcher for which to return matching results.
first - Int Returns the first n package/package version matches from the list.
after - String Opaque pagination cursor.

Example

Query
query packageRepoReferencesMatchingFilter(
  $kind: PackageRepoReferenceKind!,
  $filter: PackageVersionOrNameFilterInput!,
  $first: Int,
  $after: String
) {
  packageRepoReferencesMatchingFilter(
    kind: $kind,
    filter: $filter,
    first: $first,
    after: $after
  ) {
    ... on PackageRepoReferenceConnection {
      ...PackageRepoReferenceConnectionFragment
    }
    ... on PackageRepoReferenceVersionConnection {
      ...PackageRepoReferenceVersionConnectionFragment
    }
  }
}
Variables
{
  "kind": "GOMODULES",
  "filter": PackageVersionOrNameFilterInput,
  "first": 987,
  "after": "abc123"
}
Response
{
  "data": {
    "packageRepoReferencesMatchingFilter": PackageRepoReferenceConnection
  }
}

parseSearchQuery

Description

EXPERIMENTAL: Return the parse tree of a search query.

Response

Returns a String!

Arguments
Name Description
query - String The search query (such as "repo:myrepo foo"). Default = ""
patternType - SearchPatternType The parser to use for this query. Default = standard
outputPhase - SearchQueryOutputPhase The output corresponding to a phase in the parser pipeline. Default = PARSE_TREE
outputFormat - SearchQueryOutputFormat The parser output format. Default = JSON
outputVerbosity - SearchQueryOutputVerbosity The level of output format verbosity. Default = BASIC

Example

Query
query parseSearchQuery(
  $query: String,
  $patternType: SearchPatternType,
  $outputPhase: SearchQueryOutputPhase,
  $outputFormat: SearchQueryOutputFormat,
  $outputVerbosity: SearchQueryOutputVerbosity
) {
  parseSearchQuery(
    query: $query,
    patternType: $patternType,
    outputPhase: $outputPhase,
    outputFormat: $outputFormat,
    outputVerbosity: $outputVerbosity
  )
}
Variables
{
  "query": "",
  "patternType": "standard",
  "outputPhase": "PARSE_TREE",
  "outputFormat": "JSON",
  "outputVerbosity": "BASIC"
}
Response
{"data": {"parseSearchQuery": "abc123"}}

permissions

Description

This returns all permissions in a paginated format.

Response

Returns a PermissionConnection!

Arguments
Name Description
first - Int The limit argument for forward pagination.
last - Int The limit argument for backward pagination.
after - String The cursor argument for forward pagination.
before - String The cursor argument for backward pagination.

Example

Query
query permissions(
  $first: Int,
  $last: Int,
  $after: String,
  $before: String
) {
  permissions(
    first: $first,
    last: $last,
    after: $after,
    before: $before
  ) {
    nodes {
      ...PermissionFragment
    }
    totalCount
    pageInfo {
      ...ConnectionPageInfoFragment
    }
  }
}
Variables
{
  "first": 987,
  "last": 987,
  "after": "xyz789",
  "before": "abc123"
}
Response
{
  "data": {
    "permissions": {
      "nodes": [Permission],
      "totalCount": 123,
      "pageInfo": ConnectionPageInfo
    }
  }
}

phabricatorRepo

Description

Looks up a Phabricator repository by name.

Response

Returns a PhabricatorRepo

Arguments
Name Description
name - String The name, for example "github.com/gorilla/mux".
uri - String An alias for name. DEPRECATED: use name instead.

Example

Query
query phabricatorRepo(
  $name: String,
  $uri: String
) {
  phabricatorRepo(
    name: $name,
    uri: $uri
  ) {
    name
    uri
    callsign
    url
  }
}
Variables
{
  "name": "abc123",
  "uri": "xyz789"
}
Response
{
  "data": {
    "phabricatorRepo": {
      "name": "xyz789",
      "uri": "abc123",
      "callsign": "xyz789",
      "url": "abc123"
    }
  }
}

preciseIndexes

Description

Query precise code intelligence indexes.

Response

Returns a PreciseIndexConnection!

Arguments
Name Description
repo - ID If supplied, only precise indexes for the given repository will be returned.
query - String If supplied, only precise indexes that match the given terms by their state, repository name, commit, root, and indexer fields will be returned..
states - [PreciseIndexState!] If supplied, only precise indexes in one of the provided states are returned.
indexerKey - String If supplied, only precise indexes created by an indexer with the given key are returned.
dependencyOf - ID If supplied, only precise indexes that are a dependency of the specified index are returned.
dependentOf - ID If supplied, only precise indexes that are a dependent of the specified index are returned.
includeDeleted - Boolean When specified, merges the list of existing uploads with data from uploads that have been deleted but for which audit logs still exist. Only makes sense when state filter is unset or equal to 'DELETED'.
first - Int If specified, this limits the number of results per request.
after - String

If specified, this indicates that the request should be paginated and to fetch results starting at this cursor.

A future request can be made for more results by passing in the 'PreciseIndexConnection.pageInfo.endCursor' that is returned.

Example

Query
query preciseIndexes(
  $repo: ID,
  $query: String,
  $states: [PreciseIndexState!],
  $indexerKey: String,
  $dependencyOf: ID,
  $dependentOf: ID,
  $includeDeleted: Boolean,
  $first: Int,
  $after: String
) {
  preciseIndexes(
    repo: $repo,
    query: $query,
    states: $states,
    indexerKey: $indexerKey,
    dependencyOf: $dependencyOf,
    dependentOf: $dependentOf,
    includeDeleted: $includeDeleted,
    first: $first,
    after: $after
  ) {
    nodes {
      ...PreciseIndexFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "repo": "4",
  "query": "abc123",
  "states": ["UPLOADING_INDEX"],
  "indexerKey": "xyz789",
  "dependencyOf": "4",
  "dependentOf": "4",
  "includeDeleted": false,
  "first": 987,
  "after": "abc123"
}
Response
{
  "data": {
    "preciseIndexes": {
      "nodes": [PreciseIndex],
      "totalCount": 123,
      "pageInfo": PageInfo
    }
  }
}

previewRepositoriesFromQuery

Description

Returns the number of repositories matched given a valid query.

Response

Returns a RepositoryPreviewPayload!

Arguments
Name Description
query - String!

Example

Query
query previewRepositoriesFromQuery($query: String!) {
  previewRepositoriesFromQuery(query: $query) {
    query
    numberOfRepositories
  }
}
Variables
{"query": "xyz789"}
Response
{
  "data": {
    "previewRepositoriesFromQuery": {
      "query": "xyz789",
      "numberOfRepositories": 123
    }
  }
}

previewRepositoryFilter

Description

The set of repositories that match the given glob pattern. This resolver is used by the UI to preview what repositories match a code intelligence policy in a given repository.

Response

Returns a RepositoryFilterPreview!

Arguments
Name Description
patterns - [String!]! A set of patterns matching the name of the matching repository.
first - Int When specified, indicates that this request should return the first N items.

Example

Query
query previewRepositoryFilter(
  $patterns: [String!]!,
  $first: Int
) {
  previewRepositoryFilter(
    patterns: $patterns,
    first: $first
  ) {
    nodes {
      ...CodeIntelRepositoryFragment
    }
    totalCount
    matchesAllRepos
    limit
    totalMatches
  }
}
Variables
{"patterns": ["abc123"], "first": 123}
Response
{
  "data": {
    "previewRepositoryFilter": {
      "nodes": [CodeIntelRepository],
      "totalCount": 123,
      "matchesAllRepos": false,
      "limit": 123,
      "totalMatches": 987
    }
  }
}

rankingSummary

Description

Gets the progress of the current and historic precise ranking jobs.

Response

Returns a GlobalRankingSummary!

Example

Query
query rankingSummary {
  rankingSummary {
    rankingSummary {
      ...RankingSummaryFragment
    }
    derivativeGraphKey
    nextJobStartsAt
    numExportedIndexes
    numTargetIndexes
    numRepositoriesWithoutCurrentRanks
  }
}
Response
{
  "data": {
    "rankingSummary": {
      "rankingSummary": [RankingSummary],
      "derivativeGraphKey": "xyz789",
      "nextJobStartsAt": "2007-12-03T10:15:30Z",
      "numExportedIndexes": 987,
      "numTargetIndexes": 987,
      "numRepositoriesWithoutCurrentRanks": 987
    }
  }
}

renderMarkdown

Description

Renders Markdown to HTML. The returned HTML is already sanitized and escaped and thus is always safe to render.

Response

Returns a String!

Arguments
Name Description
markdown - String!
options - MarkdownOptions

Example

Query
query renderMarkdown(
  $markdown: String!,
  $options: MarkdownOptions
) {
  renderMarkdown(
    markdown: $markdown,
    options: $options
  )
}
Variables
{
  "markdown": "abc123",
  "options": MarkdownOptions
}
Response
{"data": {"renderMarkdown": "abc123"}}

repoEmbeddingJobs

Description

Experimental: Repo embedding jobs list.

Response

Returns a RepoEmbeddingJobsConnection!

Arguments
Name Description
first - Int Number of jobs returned. Up to 100 jobs are returned by default.
last - Int The number of nodes to return starting from the end (latest). Note: Use either last or first (see above) in the query. Setting both will return an error.
after - String Opaque pagination cursor to be used when paginating forwards that may be also used in conjunction with "first" to return the first N nodes.
before - String Opaque pagination cursor to be used when paginating backwards that may be also used in conjunction with "last" to return the last N nodes.
query - String Filter by the name of the repository.
state - String Filter by the state of the job.

Example

Query
query repoEmbeddingJobs(
  $first: Int,
  $last: Int,
  $after: String,
  $before: String,
  $query: String,
  $state: String
) {
  repoEmbeddingJobs(
    first: $first,
    last: $last,
    after: $after,
    before: $before,
    query: $query,
    state: $state
  ) {
    nodes {
      ...RepoEmbeddingJobFragment
    }
    totalCount
    pageInfo {
      ...ConnectionPageInfoFragment
    }
  }
}
Variables
{
  "first": 123,
  "last": 123,
  "after": "xyz789",
  "before": "abc123",
  "query": "abc123",
  "state": "abc123"
}
Response
{
  "data": {
    "repoEmbeddingJobs": {
      "nodes": [RepoEmbeddingJob],
      "totalCount": 123,
      "pageInfo": ConnectionPageInfo
    }
  }
}

repoMeta

Description

Repository key-value pair metadata

Response

Returns a RepoMetadata

Example

Query
query repoMeta {
  repoMeta {
    keys {
      ...RepoMetadataKeyOrValueConnectionFragment
    }
    key {
      ...RepoMetadataKeyResultFragment
    }
  }
}
Response
{
  "data": {
    "repoMeta": {
      "keys": RepoMetadataKeyOrValueConnection,
      "key": RepoMetadataKeyResult
    }
  }
}

repositories

Description

List all repositories.

Response

Returns a NewRepositoryConnection!

Arguments
Name Description
first - Int Returns the first n repositories from the list.
last - Int Returns the last n repositories from the list.
query - String Return repositories whose names match the query.
after - String An opaque cursor that is used for pagination.
before - String An opaque cursor that is used for pagination.
names - [String!] Return repositories whose names are in the list.
cloned - Boolean Include cloned repositories. Default = true
cloneStatus - CloneStatus Include only repositories of the given clone status.
notCloned - Boolean Include repositories that are not yet cloned and for which cloning is not in progress. Default = true
indexed - Boolean Include repositories that have a text search index. Default = true
notIndexed - Boolean Include repositories that do not have a text search index. Default = true
embedded - Boolean Include repositories that have embeddings. Default = true
notEmbedded - Boolean Include repositories that don't have embeddings. Default = true
failedFetch - Boolean Include only repositories that have encountered errors when cloning or fetching. Default = false
corrupted - Boolean Include repositories that are corrupt. Default = false
externalService - ID Return repositories that are associated with the given external service.
orderBy - RepositoryOrderBy Sort field. Default = REPOSITORY_NAME
descending - Boolean Sort direction. Default = false

Example

Query
query repositories(
  $first: Int,
  $last: Int,
  $query: String,
  $after: String,
  $before: String,
  $names: [String!],
  $cloned: Boolean,
  $cloneStatus: CloneStatus,
  $notCloned: Boolean,
  $indexed: Boolean,
  $notIndexed: Boolean,
  $embedded: Boolean,
  $notEmbedded: Boolean,
  $failedFetch: Boolean,
  $corrupted: Boolean,
  $externalService: ID,
  $orderBy: RepositoryOrderBy,
  $descending: Boolean
) {
  repositories(
    first: $first,
    last: $last,
    query: $query,
    after: $after,
    before: $before,
    names: $names,
    cloned: $cloned,
    cloneStatus: $cloneStatus,
    notCloned: $notCloned,
    indexed: $indexed,
    notIndexed: $notIndexed,
    embedded: $embedded,
    notEmbedded: $notEmbedded,
    failedFetch: $failedFetch,
    corrupted: $corrupted,
    externalService: $externalService,
    orderBy: $orderBy,
    descending: $descending
  ) {
    nodes {
      ...RepositoryFragment
    }
    totalCount
    pageInfo {
      ...ConnectionPageInfoFragment
    }
  }
}
Variables
{
  "first": 987,
  "last": 987,
  "query": "abc123",
  "after": "xyz789",
  "before": "xyz789",
  "names": ["xyz789"],
  "cloned": true,
  "cloneStatus": "NOT_CLONED",
  "notCloned": true,
  "indexed": true,
  "notIndexed": true,
  "embedded": true,
  "notEmbedded": true,
  "failedFetch": false,
  "corrupted": false,
  "externalService": "4",
  "orderBy": "REPOSITORY_NAME",
  "descending": false
}
Response
{
  "data": {
    "repositories": {
      "nodes": [Repository],
      "totalCount": 123,
      "pageInfo": ConnectionPageInfo
    }
  }
}

repository

Description

Looks up a repository by either name or cloneURL.

Response

Returns a Repository

Arguments
Name Description
name - String Query the repository by name, for example "github.com/gorilla/mux".
cloneURL - String Query the repository by a Git clone URL (format documented here: https://git-scm.com/docs/git-clone_git_urls_a_id_urls_a) by checking for a code host configuration that matches the clone URL. Will not actually check the code host to see if the repository actually exists.
uri - String An alias for name. DEPRECATED: use name instead.

Example

Query
query repository(
  $name: String,
  $cloneURL: String,
  $uri: String
) {
  repository(
    name: $name,
    cloneURL: $cloneURL,
    uri: $uri
  ) {
    id
    name
    uri
    sourceType
    description
    language
    createdAt
    updatedAt
    commit {
      ...GitCommitFragment
    }
    changelist {
      ...PerforceChangelistFragment
    }
    firstEverCommit {
      ...GitCommitFragment
    }
    mirrorInfo {
      ...MirrorRepositoryInfoFragment
    }
    externalRepository {
      ...ExternalRepositoryFragment
    }
    isFork
    isArchived
    isPrivate
    externalServices {
      ...ExternalServiceConnectionFragment
    }
    cloneInProgress
    textSearchIndex {
      ...RepositoryTextSearchIndexFragment
    }
    url
    externalURLs {
      ...ExternalLinkFragment
    }
    defaultBranch {
      ...GitRefFragment
    }
    gitRefs {
      ...GitRefConnectionFragment
    }
    branches {
      ...GitRefConnectionFragment
    }
    tags {
      ...GitRefConnectionFragment
    }
    comparison {
      ...RepositoryComparisonFragment
    }
    contributors {
      ...RepositoryContributorConnectionFragment
    }
    viewerCanAdminister
    label {
      ...MarkdownFragment
    }
    detail {
      ...MarkdownFragment
    }
    matches {
      ...SearchResultMatchFragment
    }
    codeIntelligenceCommitGraph {
      ...CodeIntelligenceCommitGraphFragment
    }
    stars
    keyValuePairs {
      ...KeyValuePairFragment
    }
    metadata {
      ...KeyValuePairFragment
    }
    topics
    diskSizeBytes
    embeddingExists
    isRecordingEnabled
    recordedCommands {
      ...RecordedCommandConnectionFragment
    }
    changesetsStats {
      ...RepoChangesetsStatsFragment
    }
    batchChanges {
      ...BatchChangeConnectionFragment
    }
    batchChangesDiffStat {
      ...DiffStatFragment
    }
    indexConfiguration {
      ...IndexConfigurationFragment
    }
    codeIntelSummary {
      ...CodeIntelRepositorySummaryFragment
    }
    previewGitObjectFilter {
      ...GitObjectFilterPreviewFragment
    }
    embeddingJobs {
      ...RepoEmbeddingJobsConnectionFragment
    }
    ingestedCodeowners {
      ...CodeownersIngestedFileFragment
    }
  }
}
Variables
{
  "name": "xyz789",
  "cloneURL": "xyz789",
  "uri": "abc123"
}
Response
{
  "data": {
    "repository": {
      "id": 4,
      "name": "abc123",
      "uri": "abc123",
      "sourceType": "GIT_REPOSITORY",
      "description": "xyz789",
      "language": "abc123",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "commit": GitCommit,
      "changelist": PerforceChangelist,
      "firstEverCommit": GitCommit,
      "mirrorInfo": MirrorRepositoryInfo,
      "externalRepository": ExternalRepository,
      "isFork": false,
      "isArchived": true,
      "isPrivate": true,
      "externalServices": ExternalServiceConnection,
      "cloneInProgress": true,
      "textSearchIndex": RepositoryTextSearchIndex,
      "url": "abc123",
      "externalURLs": [ExternalLink],
      "defaultBranch": GitRef,
      "gitRefs": GitRefConnection,
      "branches": GitRefConnection,
      "tags": GitRefConnection,
      "comparison": RepositoryComparison,
      "contributors": RepositoryContributorConnection,
      "viewerCanAdminister": true,
      "label": Markdown,
      "detail": Markdown,
      "matches": [SearchResultMatch],
      "codeIntelligenceCommitGraph": CodeIntelligenceCommitGraph,
      "stars": 123,
      "keyValuePairs": [KeyValuePair],
      "metadata": [KeyValuePair],
      "topics": ["abc123"],
      "diskSizeBytes": {},
      "embeddingExists": true,
      "isRecordingEnabled": true,
      "recordedCommands": RecordedCommandConnection,
      "changesetsStats": RepoChangesetsStats,
      "batchChanges": BatchChangeConnection,
      "batchChangesDiffStat": DiffStat,
      "indexConfiguration": IndexConfiguration,
      "codeIntelSummary": CodeIntelRepositorySummary,
      "previewGitObjectFilter": GitObjectFilterPreview,
      "embeddingJobs": RepoEmbeddingJobsConnection,
      "ingestedCodeowners": CodeownersIngestedFile
    }
  }
}

repositoryRedirect

Description

Looks up a repository by either name or cloneURL or hashedName. When the repository does not exist on the server, it returns a Redirect to an external Sourcegraph URL that may have this repository instead. Otherwise, this query returns null.

Response

Returns a RepositoryRedirect

Arguments
Name Description
name - String Query the repository by name, for example "github.com/gorilla/mux".
cloneURL - String Query the repository by a Git clone URL (format documented here: https://git-scm.com/docs/git-clone_git_urls_a_id_urls_a) by checking for a code host configuration that matches the clone URL. Will not actually check the code host to see if the repository actually exists.
hashedName - String Query the repository by hashed name. Hashed name is a SHA256 checksum of the absolute repo name in lower case, for example "github.com/sourcegraph/sourcegraph" -> "a6c905ceb7dec9a565945ceded8c7fa4154250df8b928fb40673b535d9a24c2f"

Example

Query
query repositoryRedirect(
  $name: String,
  $cloneURL: String,
  $hashedName: String
) {
  repositoryRedirect(
    name: $name,
    cloneURL: $cloneURL,
    hashedName: $hashedName
  ) {
    ... on Repository {
      ...RepositoryFragment
    }
    ... on Redirect {
      ...RedirectFragment
    }
  }
}
Variables
{
  "name": "xyz789",
  "cloneURL": "xyz789",
  "hashedName": "xyz789"
}
Response
{"data": {"repositoryRedirect": Repository}}

repositoryStats

Description

FOR INTERNAL USE ONLY: Query repository statistics for the site.

Response

Returns a RepositoryStats!

Example

Query
query repositoryStats {
  repositoryStats {
    gitDirBytes
    indexedLinesCount
    total
    cloned
    cloning
    notCloned
    failedFetch
    indexed
    corrupted
    embedded
  }
}
Response
{
  "data": {
    "repositoryStats": {
      "gitDirBytes": {},
      "indexedLinesCount": {},
      "total": 123,
      "cloned": 123,
      "cloning": 987,
      "notCloned": 987,
      "failedFetch": 987,
      "indexed": 123,
      "corrupted": 123,
      "embedded": 987
    }
  }
}

resolveWorkspacesForBatchSpec

Description

Takes the batch spec as input and resolves the workspaces for it, without persisting them. This endpoint is used in src-cli to resolve workspaces.

Arguments
Name Description
batchSpec - String!

Example

Query
query resolveWorkspacesForBatchSpec($batchSpec: String!) {
  resolveWorkspacesForBatchSpec(batchSpec: $batchSpec) {
    repository {
      ...RepositoryFragment
    }
    branch {
      ...GitRefFragment
    }
    path
    onlyFetchWorkspace
    ignored
    unsupported
    searchResultPaths
  }
}
Variables
{"batchSpec": "abc123"}
Response
{
  "data": {
    "resolveWorkspacesForBatchSpec": [
      {
        "repository": Repository,
        "branch": GitRef,
        "path": "xyz789",
        "onlyFetchWorkspace": true,
        "ignored": false,
        "unsupported": true,
        "searchResultPaths": ["abc123"]
      }
    ]
  }
}

roles

Description

Roles returns all the roles in the database that matches the arguments.

Response

Returns a RoleConnection!

Arguments
Name Description
first - Int The limit argument for forward pagination.
last - Int The limit argument for backward pagination.
after - String The cursor argument for forward pagination.
before - String The cursor argument for backward pagination.

Example

Query
query roles(
  $first: Int,
  $last: Int,
  $after: String,
  $before: String
) {
  roles(
    first: $first,
    last: $last,
    after: $after,
    before: $before
  ) {
    nodes {
      ...RoleFragment
    }
    totalCount
    pageInfo {
      ...ConnectionPageInfoFragment
    }
  }
}
Variables
{
  "first": 123,
  "last": 987,
  "after": "abc123",
  "before": "xyz789"
}
Response
{
  "data": {
    "roles": {
      "nodes": [Role],
      "totalCount": 123,
      "pageInfo": ConnectionPageInfo
    }
  }
}

root

this will be removed.
Description

The root of the query.

Response

Returns a Query!

Example

Query
query root {
  root {
    root {
      ...QueryFragment
    }
    node {
      ...NodeFragment
    }
    repository {
      ...RepositoryFragment
    }
    repositoryRedirect {
      ... on Repository {
        ...RepositoryFragment
      }
      ... on Redirect {
        ...RedirectFragment
      }
    }
    externalServices {
      ...ExternalServiceConnectionFragment
    }
    externalServiceNamespaces {
      ...ExternalServiceNamespaceConnectionFragment
    }
    externalServiceRepositories {
      ...ExternalServiceRepositoryConnectionFragment
    }
    repositories {
      ...NewRepositoryConnectionFragment
    }
    packageRepoReferences {
      ...PackageRepoReferenceConnectionFragment
    }
    packageRepoFilters {
      ...PackageFilterFragment
    }
    packageRepoReferencesMatchingFilter {
      ... on PackageRepoReferenceConnection {
        ...PackageRepoReferenceConnectionFragment
      }
      ... on PackageRepoReferenceVersionConnection {
        ...PackageRepoReferenceVersionConnectionFragment
      }
    }
    phabricatorRepo {
      ...PhabricatorRepoFragment
    }
    currentUser {
      ...UserFragment
    }
    user {
      ...UserFragment
    }
    users {
      ...UserConnectionFragment
    }
    organization {
      ...OrgFragment
    }
    organizations {
      ...OrgConnectionFragment
    }
    renderMarkdown
    highlightCode
    settingsSubject {
      ...SettingsSubjectFragment
    }
    viewerSettings {
      ...SettingsCascadeFragment
    }
    viewerConfiguration {
      ...ConfigurationCascadeFragment
    }
    clientConfiguration {
      ...ClientConfigurationDetailsFragment
    }
    search {
      ...SearchFragment
    }
    savedSearches {
      ...SavedSearchesConnectionFragment
    }
    parseSearchQuery
    site {
      ...SiteFragment
    }
    surveyResponses {
      ...SurveyResponseConnectionFragment
    }
    statusMessages {
      ... on GitUpdatesDisabled {
        ...GitUpdatesDisabledFragment
      }
      ... on NoRepositoriesDetected {
        ...NoRepositoriesDetectedFragment
      }
      ... on CloningProgress {
        ...CloningProgressFragment
      }
      ... on ExternalServiceSyncError {
        ...ExternalServiceSyncErrorFragment
      }
      ... on SyncError {
        ...SyncErrorFragment
      }
      ... on IndexingProgress {
        ...IndexingProgressFragment
      }
      ... on GitserverDiskThresholdReached {
        ...GitserverDiskThresholdReachedFragment
      }
    }
    repositoryStats {
      ...RepositoryStatsFragment
    }
    namespace {
      ...NamespaceFragment
    }
    namespaceByName {
      ...NamespaceFragment
    }
    codeHostSyncDue
    outOfBandMigrations {
      ...OutOfBandMigrationFragment
    }
    featureFlags {
      ... on FeatureFlagBoolean {
        ...FeatureFlagBooleanFragment
      }
      ... on FeatureFlagRollout {
        ...FeatureFlagRolloutFragment
      }
    }
    featureFlag {
      ... on FeatureFlagBoolean {
        ...FeatureFlagBooleanFragment
      }
      ... on FeatureFlagRollout {
        ...FeatureFlagRolloutFragment
      }
    }
    evaluateFeatureFlag
    evaluatedFeatureFlags {
      ...EvaluatedFeatureFlagFragment
    }
    organizationFeatureFlagValue
    organizationFeatureFlagOverrides {
      ...FeatureFlagOverrideFragment
    }
    temporarySettings {
      ...TemporarySettingsFragment
    }
    webhookLogs {
      ...WebhookLogConnectionFragment
    }
    outboundRequests {
      ...OutboundRequestConnectionFragment
    }
    backgroundJobs {
      ...BackgroundJobConnectionFragment
    }
    invitationByToken {
      ...OrganizationInvitationFragment
    }
    autocompleteMembersSearch {
      ...AutocompleteMemberSearchItemFragment
    }
    orgMembersSummary {
      ...OrgMembersSummaryFragment
    }
    webhooks {
      ...WebhookConnectionFragment
    }
    slowRequests {
      ...SlowRequestConnectionFragment
    }
    roles {
      ...RoleConnectionFragment
    }
    permissions {
      ...PermissionConnectionFragment
    }
    gitservers {
      ...GitserverInstanceConnectionFragment
    }
    executorSecrets {
      ...ExecutorSecretConnectionFragment
    }
    executors {
      ...ExecutorConnectionFragment
    }
    areExecutorsConfigured
    team {
      ...TeamFragment
    }
    teams {
      ...TeamConnectionFragment
    }
    accessRequests {
      ...AccessRequestConnectionFragment
    }
    repoMeta {
      ...RepoMetadataFragment
    }
    codeHosts {
      ...CodeHostConnectionFragment
    }
    gitHubApps {
      ...GitHubAppConnectionFragment
    }
    gitHubApp {
      ...GitHubAppFragment
    }
    gitHubAppByAppID {
      ...GitHubAppFragment
    }
    batchChanges {
      ...BatchChangeConnectionFragment
    }
    batchChange {
      ...BatchChangeFragment
    }
    globalChangesetsStats {
      ...GlobalChangesetsStatsFragment
    }
    batchChangesCodeHosts {
      ...BatchChangesCodeHostConnectionFragment
    }
    availableBulkOperations
    batchSpecs {
      ...BatchSpecConnectionFragment
    }
    checkBatchChangesCredential {
      ...EmptyResponseFragment
    }
    resolveWorkspacesForBatchSpec {
      ...ResolvedBatchSpecWorkspaceFragment
    }
    maxUnlicensedChangesets
    getChangesetsByIDs {
      ...ChangesetConnectionFragment
    }
    preciseIndexes {
      ...PreciseIndexConnectionFragment
    }
    codeIntelSummary {
      ...CodeIntelSummaryFragment
    }
    indexerKeys
    codeIntelligenceInferenceScript
    inferAutoIndexJobsForRepo {
      ...InferAutoIndexJobsResultFragment
    }
    codeIntelligenceConfigurationPolicies {
      ...CodeIntelligenceConfigurationPolicyConnectionFragment
    }
    previewRepositoryFilter {
      ...RepositoryFilterPreviewFragment
    }
    rankingSummary {
      ...GlobalRankingSummaryFragment
    }
    vulnerabilities {
      ...VulnerabilityConnectionFragment
    }
    vulnerabilityMatches {
      ...VulnerabilityMatchConnectionFragment
    }
    vulnerabilityMatchesCountByRepository {
      ...VulnerabilityMatchCountByRepositoryConnectionFragment
    }
    vulnerabilityMatchesSummaryCounts {
      ...VulnerabilityMatchesSummaryCountFragment
    }
    getCodyContext {
      ... on FileChunkContext {
        ...FileChunkContextFragment
      }
    }
    completions
    compute {
      ... on ComputeMatchContext {
        ...ComputeMatchContextFragment
      }
      ... on ComputeText {
        ...ComputeTextFragment
      }
    }
    onboardingTourContent {
      ...OnboardingTourFragment
    }
    dotcom {
      ...DotcomQueryFragment
    }
    embeddingsSearch {
      ...EmbeddingsSearchResultsFragment
    }
    embeddingsMultiSearch {
      ...EmbeddingsSearchResultsFragment
    }
    isContextRequiredForChatQuery
    repoEmbeddingJobs {
      ...RepoEmbeddingJobsConnectionFragment
    }
    snippetAttribution {
      ...SnippetAttributionConnectionFragment
    }
    insightsDashboards {
      ...InsightsDashboardConnectionFragment
    }
    insightViews {
      ...InsightViewConnectionFragment
    }
    searchInsightLivePreview {
      ...SearchInsightLivePreviewSeriesFragment
    }
    searchInsightPreview {
      ...SearchInsightLivePreviewSeriesFragment
    }
    insightSeriesQueryStatus {
      ...InsightSeriesQueryStatusFragment
    }
    insightViewDebug {
      ...InsightViewDebugFragment
    }
    validateScopedInsightQuery {
      ...ScopedInsightQueryPayloadFragment
    }
    previewRepositoriesFromQuery {
      ...RepositoryPreviewPayloadFragment
    }
    insightAdminBackfillQueue {
      ...InsightBackfillQueueItemConnectionFragment
    }
    searchQueryAggregate {
      ...SearchQueryAggregateFragment
    }
    enterpriseLicenseHasFeature
    notebooks {
      ...NotebookConnectionFragment
    }
    outboundWebhooks {
      ...OutboundWebhookConnectionFragment
    }
    outboundWebhookEventTypes {
      ...OutboundWebhookEventTypeFragment
    }
    codeownersIngestedFiles {
      ...CodeownersIngestedFileConnectionFragment
    }
    ownSignalConfigurations {
      ...OwnSignalConfigurationFragment
    }
    instanceOwnershipStats {
      ...OwnershipStatsFragment
    }
    searchContexts {
      ...SearchContextConnectionFragment
    }
    searchContextBySpec {
      ...SearchContextFragment
    }
    isSearchContextAvailable
    defaultSearchContext {
      ...SearchContextFragment
    }
    validateSearchJob {
      ...EmptyResponseFragment
    }
    searchJobs {
      ...SearchJobConnectionFragment
    }
    telemetry {
      ...TelemetryQueryFragment
    }
  }
}
Response
{
  "data": {
    "root": {
      "root": Query,
      "node": Node,
      "repository": Repository,
      "repositoryRedirect": Repository,
      "externalServices": ExternalServiceConnection,
      "externalServiceNamespaces": ExternalServiceNamespaceConnection,
      "externalServiceRepositories": ExternalServiceRepositoryConnection,
      "repositories": NewRepositoryConnection,
      "packageRepoReferences": PackageRepoReferenceConnection,
      "packageRepoFilters": [PackageFilter],
      "packageRepoReferencesMatchingFilter": PackageRepoReferenceConnection,
      "phabricatorRepo": PhabricatorRepo,
      "currentUser": User,
      "user": User,
      "users": UserConnection,
      "organization": Org,
      "organizations": OrgConnection,
      "renderMarkdown": "xyz789",
      "highlightCode": "abc123",
      "settingsSubject": SettingsSubject,
      "viewerSettings": SettingsCascade,
      "viewerConfiguration": ConfigurationCascade,
      "clientConfiguration": ClientConfigurationDetails,
      "search": Search,
      "savedSearches": SavedSearchesConnection,
      "parseSearchQuery": "abc123",
      "site": Site,
      "surveyResponses": SurveyResponseConnection,
      "statusMessages": [GitUpdatesDisabled],
      "repositoryStats": RepositoryStats,
      "namespace": Namespace,
      "namespaceByName": Namespace,
      "codeHostSyncDue": false,
      "outOfBandMigrations": [OutOfBandMigration],
      "featureFlags": [FeatureFlagBoolean],
      "featureFlag": FeatureFlagBoolean,
      "evaluateFeatureFlag": false,
      "evaluatedFeatureFlags": [EvaluatedFeatureFlag],
      "organizationFeatureFlagValue": false,
      "organizationFeatureFlagOverrides": [
        FeatureFlagOverride
      ],
      "temporarySettings": TemporarySettings,
      "webhookLogs": WebhookLogConnection,
      "outboundRequests": OutboundRequestConnection,
      "backgroundJobs": BackgroundJobConnection,
      "invitationByToken": OrganizationInvitation,
      "autocompleteMembersSearch": [
        AutocompleteMemberSearchItem
      ],
      "orgMembersSummary": OrgMembersSummary,
      "webhooks": WebhookConnection,
      "slowRequests": SlowRequestConnection,
      "roles": RoleConnection,
      "permissions": PermissionConnection,
      "gitservers": GitserverInstanceConnection,
      "executorSecrets": ExecutorSecretConnection,
      "executors": ExecutorConnection,
      "areExecutorsConfigured": false,
      "team": Team,
      "teams": TeamConnection,
      "accessRequests": AccessRequestConnection,
      "repoMeta": RepoMetadata,
      "codeHosts": CodeHostConnection,
      "gitHubApps": GitHubAppConnection,
      "gitHubApp": GitHubApp,
      "gitHubAppByAppID": GitHubApp,
      "batchChanges": BatchChangeConnection,
      "batchChange": BatchChange,
      "globalChangesetsStats": GlobalChangesetsStats,
      "batchChangesCodeHosts": BatchChangesCodeHostConnection,
      "availableBulkOperations": ["COMMENT"],
      "batchSpecs": BatchSpecConnection,
      "checkBatchChangesCredential": EmptyResponse,
      "resolveWorkspacesForBatchSpec": [
        ResolvedBatchSpecWorkspace
      ],
      "maxUnlicensedChangesets": 987,
      "getChangesetsByIDs": ChangesetConnection,
      "preciseIndexes": PreciseIndexConnection,
      "codeIntelSummary": CodeIntelSummary,
      "indexerKeys": ["xyz789"],
      "codeIntelligenceInferenceScript": "abc123",
      "inferAutoIndexJobsForRepo": InferAutoIndexJobsResult,
      "codeIntelligenceConfigurationPolicies": CodeIntelligenceConfigurationPolicyConnection,
      "previewRepositoryFilter": RepositoryFilterPreview,
      "rankingSummary": GlobalRankingSummary,
      "vulnerabilities": VulnerabilityConnection,
      "vulnerabilityMatches": VulnerabilityMatchConnection,
      "vulnerabilityMatchesCountByRepository": VulnerabilityMatchCountByRepositoryConnection,
      "vulnerabilityMatchesSummaryCounts": VulnerabilityMatchesSummaryCount,
      "getCodyContext": [FileChunkContext],
      "completions": "abc123",
      "compute": [ComputeMatchContext],
      "onboardingTourContent": OnboardingTour,
      "dotcom": DotcomQuery,
      "embeddingsSearch": EmbeddingsSearchResults,
      "embeddingsMultiSearch": EmbeddingsSearchResults,
      "isContextRequiredForChatQuery": false,
      "repoEmbeddingJobs": RepoEmbeddingJobsConnection,
      "snippetAttribution": SnippetAttributionConnection,
      "insightsDashboards": InsightsDashboardConnection,
      "insightViews": InsightViewConnection,
      "searchInsightLivePreview": [
        SearchInsightLivePreviewSeries
      ],
      "searchInsightPreview": [
        SearchInsightLivePreviewSeries
      ],
      "insightSeriesQueryStatus": [
        InsightSeriesQueryStatus
      ],
      "insightViewDebug": InsightViewDebug,
      "validateScopedInsightQuery": ScopedInsightQueryPayload,
      "previewRepositoriesFromQuery": RepositoryPreviewPayload,
      "insightAdminBackfillQueue": InsightBackfillQueueItemConnection,
      "searchQueryAggregate": SearchQueryAggregate,
      "enterpriseLicenseHasFeature": false,
      "notebooks": NotebookConnection,
      "outboundWebhooks": OutboundWebhookConnection,
      "outboundWebhookEventTypes": [
        OutboundWebhookEventType
      ],
      "codeownersIngestedFiles": CodeownersIngestedFileConnection,
      "ownSignalConfigurations": [OwnSignalConfiguration],
      "instanceOwnershipStats": OwnershipStats,
      "searchContexts": SearchContextConnection,
      "searchContextBySpec": SearchContext,
      "isSearchContextAvailable": false,
      "defaultSearchContext": SearchContext,
      "validateSearchJob": EmptyResponse,
      "searchJobs": SearchJobConnection,
      "telemetry": TelemetryQuery
    }
  }
}

savedSearches

Description

List of saved searches based on namespace

Response

Returns a SavedSearchesConnection!

Arguments
Name Description
namespace - ID! The namespace to list the saved searches for.
first - Int The limit argument for forward pagination.
last - Int The limit argument for backward pagination.
after - String The cursor argument for forward pagination.
before - String The cursor argument for backward pagination.

Example

Query
query savedSearches(
  $namespace: ID!,
  $first: Int,
  $last: Int,
  $after: String,
  $before: String
) {
  savedSearches(
    namespace: $namespace,
    first: $first,
    last: $last,
    after: $after,
    before: $before
  ) {
    nodes {
      ...SavedSearchFragment
    }
    totalCount
    pageInfo {
      ...ConnectionPageInfoFragment
    }
  }
}
Variables
{
  "namespace": 4,
  "first": 123,
  "last": 987,
  "after": "xyz789",
  "before": "xyz789"
}
Response
{
  "data": {
    "savedSearches": {
      "nodes": [SavedSearch],
      "totalCount": 987,
      "pageInfo": ConnectionPageInfo
    }
  }
}

searchContextBySpec

Description

Fetch search context by spec (global, @username, @username/ctx, etc.).

Response

Returns a SearchContext

Arguments
Name Description
spec - String!

Example

Query
query searchContextBySpec($spec: String!) {
  searchContextBySpec(spec: $spec) {
    id
    name
    namespace {
      ...NamespaceFragment
    }
    description
    spec
    autoDefined
    query
    repositories {
      ...SearchContextRepositoryRevisionsFragment
    }
    public
    updatedAt
    viewerCanManage
    viewerHasAsDefault
    viewerHasStarred
  }
}
Variables
{"spec": "abc123"}
Response
{
  "data": {
    "searchContextBySpec": {
      "id": "4",
      "name": "abc123",
      "namespace": Namespace,
      "description": "abc123",
      "spec": "xyz789",
      "autoDefined": true,
      "query": "abc123",
      "repositories": [SearchContextRepositoryRevisions],
      "public": true,
      "updatedAt": "2007-12-03T10:15:30Z",
      "viewerCanManage": false,
      "viewerHasAsDefault": false,
      "viewerHasStarred": true
    }
  }
}

searchContexts

Description

All available user-defined search contexts. Excludes auto-defined contexts.

Response

Returns a SearchContextConnection!

Arguments
Name Description
first - Int Returns the first n search contexts from the list. Default = 50
after - String Opaque pagination cursor.
query - String Query to filter the search contexts by spec.
namespaces - [ID] Include search contexts matching the provided namespaces. A union of all matching search contexts is returned. ID can either be a user ID, org ID, or nil to match instance-level contexts. Empty namespaces list defaults to returning all available search contexts. Example: namespaces: [user1, org1, org2, nil] will return search contexts created by user1 + contexts created by org1 + contexts created by org2 + all instance-level contexts. Default = []
orderBy - SearchContextsOrderBy Sort field. Despite the value, the results are always sorted with the global context first, user's default context next, followed by the user's starred contexts, followed by the rest of the contexts. This controls the order of these internal groups. Default = SEARCH_CONTEXT_SPEC
descending - Boolean Sort direction. Default = false

Example

Query
query searchContexts(
  $first: Int,
  $after: String,
  $query: String,
  $namespaces: [ID],
  $orderBy: SearchContextsOrderBy,
  $descending: Boolean
) {
  searchContexts(
    first: $first,
    after: $after,
    query: $query,
    namespaces: $namespaces,
    orderBy: $orderBy,
    descending: $descending
  ) {
    nodes {
      ...SearchContextFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "first": 50,
  "after": "xyz789",
  "query": "xyz789",
  "namespaces": [""],
  "orderBy": "SEARCH_CONTEXT_SPEC",
  "descending": false
}
Response
{
  "data": {
    "searchContexts": {
      "nodes": [SearchContext],
      "totalCount": 987,
      "pageInfo": PageInfo
    }
  }
}

searchInsightLivePreview

Description

Generate an ephemeral time series for a Search based code insight, generally for the purposes of live preview.

Arguments
Name Description
input - SearchInsightLivePreviewInput!

Example

Query
query searchInsightLivePreview($input: SearchInsightLivePreviewInput!) {
  searchInsightLivePreview(input: $input) {
    points {
      ...InsightDataPointFragment
    }
    label
  }
}
Variables
{"input": SearchInsightLivePreviewInput}
Response
{
  "data": {
    "searchInsightLivePreview": [
      {
        "points": [InsightDataPoint],
        "label": "abc123"
      }
    ]
  }
}

searchInsightPreview

Description

Generate an ephemeral set of time series for a code insight, generally for the purposes of live preview.

Arguments
Name Description
input - SearchInsightPreviewInput!

Example

Query
query searchInsightPreview($input: SearchInsightPreviewInput!) {
  searchInsightPreview(input: $input) {
    points {
      ...InsightDataPointFragment
    }
    label
  }
}
Variables
{"input": SearchInsightPreviewInput}
Response
{
  "data": {
    "searchInsightPreview": [
      {
        "points": [InsightDataPoint],
        "label": "xyz789"
      }
    ]
  }
}

searchJobs

Description

EXPERIMENTAL: Get a list of search jobs.

Response

Returns a SearchJobConnection!

Arguments
Name Description
first - Int The number of results to return.
last - Int Note: Use either last or first (see above) in the query. Setting both will return an error.
after - String The cursor to start at.
before - String Opaque pagination cursor to be used when paginating backwards.
userIDs - [ID!] List of users ids by which we will filter out search jobs list.
query - String The query to filter the results by.
states - [SearchJobState!] The states to filter the results by.
orderBy - SearchJobsOrderBy The order by which to sort the results. Default = CREATED_AT
descending - Boolean The determines the order of the returned searches. Defaults to ascending. Default = false

Example

Query
query searchJobs(
  $first: Int,
  $last: Int,
  $after: String,
  $before: String,
  $userIDs: [ID!],
  $query: String,
  $states: [SearchJobState!],
  $orderBy: SearchJobsOrderBy,
  $descending: Boolean
) {
  searchJobs(
    first: $first,
    last: $last,
    after: $after,
    before: $before,
    userIDs: $userIDs,
    query: $query,
    states: $states,
    orderBy: $orderBy,
    descending: $descending
  ) {
    nodes {
      ...SearchJobFragment
    }
    totalCount
    pageInfo {
      ...BidirectionalPageInfoFragment
    }
  }
}
Variables
{
  "first": 987,
  "last": 123,
  "after": "xyz789",
  "before": "abc123",
  "userIDs": ["4"],
  "query": "abc123",
  "states": ["QUEUED"],
  "orderBy": "CREATED_AT",
  "descending": false
}
Response
{
  "data": {
    "searchJobs": {
      "nodes": [SearchJob],
      "totalCount": 123,
      "pageInfo": BidirectionalPageInfo
    }
  }
}

searchQueryAggregate

Description

Returns information about aggregating the potential results of a search query.

Response

Returns a SearchQueryAggregate!

Arguments
Name Description
query - String!
patternType - SearchPatternType!

Example

Query
query searchQueryAggregate(
  $query: String!,
  $patternType: SearchPatternType!
) {
  searchQueryAggregate(
    query: $query,
    patternType: $patternType
  ) {
    modeAvailability {
      ...AggregationModeAvailabilityFragment
    }
    aggregations {
      ... on ExhaustiveSearchAggregationResult {
        ...ExhaustiveSearchAggregationResultFragment
      }
      ... on NonExhaustiveSearchAggregationResult {
        ...NonExhaustiveSearchAggregationResultFragment
      }
      ... on SearchAggregationNotAvailable {
        ...SearchAggregationNotAvailableFragment
      }
    }
  }
}
Variables
{
  "query": "xyz789",
  "patternType": "standard"
}
Response
{
  "data": {
    "searchQueryAggregate": {
      "modeAvailability": [AggregationModeAvailability],
      "aggregations": ExhaustiveSearchAggregationResult
    }
  }
}

settingsSubject

Description

Looks up an instance of a type that implements SettingsSubject (i.e., something that has settings). This can be a site (which has global settings), an organization, or a user.

Response

Returns a SettingsSubject

Arguments
Name Description
id - ID!

Example

Query
query settingsSubject($id: ID!) {
  settingsSubject(id: $id) {
    id
    latestSettings {
      ...SettingsFragment
    }
    settingsURL
    viewerCanAdminister
    settingsCascade {
      ...SettingsCascadeFragment
    }
    configurationCascade {
      ...ConfigurationCascadeFragment
    }
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "settingsSubject": {
      "id": 4,
      "latestSettings": Settings,
      "settingsURL": "abc123",
      "viewerCanAdminister": false,
      "settingsCascade": SettingsCascade,
      "configurationCascade": ConfigurationCascade
    }
  }
}

site

Description

The current site.

Response

Returns a Site!

Example

Query
query site {
  site {
    id
    siteID
    configuration {
      ...SiteConfigurationFragment
    }
    latestSettings {
      ...SettingsFragment
    }
    settingsCascade {
      ...SettingsCascadeFragment
    }
    configurationCascade {
      ...ConfigurationCascadeFragment
    }
    settingsURL
    canReloadSite
    viewerCanAdminister
    accessTokens {
      ...AccessTokenConnectionFragment
    }
    authProviders {
      ...AuthProviderConnectionFragment
    }
    externalAccounts {
      ...ExternalAccountConnectionFragment
    }
    buildVersion
    productVersion
    updateCheck {
      ...UpdateCheckFragment
    }
    needsRepositoryConfiguration
    externalServicesFromFile
    allowEditExternalServicesWithFile
    freeUsersExceeded
    alerts {
      ...AlertFragment
    }
    hasCodeIntelligence
    sendsEmailVerificationEmails
    productSubscription {
      ...ProductSubscriptionStatusFragment
    }
    usageStatistics {
      ...SiteUsageStatisticsFragment
    }
    analytics {
      ...AnalyticsFragment
    }
    users {
      ...SiteUsersFragment
    }
    monitoringStatistics {
      ...MonitoringStatisticsFragment
    }
    allowSiteSettingsEdits
    upgradeReadiness {
      ...UpgradeReadinessFragment
    }
    autoUpgradeEnabled
    perUserCompletionsQuota
    perUserCodeCompletionsQuota
    requiresVerifiedEmailForCody
    isCodyEnabled
    codyLLMConfiguration {
      ...CodyLLMConfigurationFragment
    }
    codyConfigFeatures {
      ...CodyConfigFeaturesFragment
    }
    codyGatewayRateLimitStatus {
      ...CodyGatewayRateLimitStatusFragment
    }
  }
}
Response
{
  "data": {
    "site": {
      "id": "4",
      "siteID": "abc123",
      "configuration": SiteConfiguration,
      "latestSettings": Settings,
      "settingsCascade": SettingsCascade,
      "configurationCascade": ConfigurationCascade,
      "settingsURL": "xyz789",
      "canReloadSite": true,
      "viewerCanAdminister": false,
      "accessTokens": AccessTokenConnection,
      "authProviders": AuthProviderConnection,
      "externalAccounts": ExternalAccountConnection,
      "buildVersion": "abc123",
      "productVersion": "xyz789",
      "updateCheck": UpdateCheck,
      "needsRepositoryConfiguration": false,
      "externalServicesFromFile": false,
      "allowEditExternalServicesWithFile": true,
      "freeUsersExceeded": true,
      "alerts": [Alert],
      "hasCodeIntelligence": false,
      "sendsEmailVerificationEmails": false,
      "productSubscription": ProductSubscriptionStatus,
      "usageStatistics": SiteUsageStatistics,
      "analytics": Analytics,
      "users": SiteUsers,
      "monitoringStatistics": MonitoringStatistics,
      "allowSiteSettingsEdits": true,
      "upgradeReadiness": UpgradeReadiness,
      "autoUpgradeEnabled": true,
      "perUserCompletionsQuota": 987,
      "perUserCodeCompletionsQuota": 123,
      "requiresVerifiedEmailForCody": false,
      "isCodyEnabled": false,
      "codyLLMConfiguration": CodyLLMConfiguration,
      "codyConfigFeatures": CodyConfigFeatures,
      "codyGatewayRateLimitStatus": [
        CodyGatewayRateLimitStatus
      ]
    }
  }
}

slowRequests

Description

List slow GraphQL requests that were recently captured (requires site-admin permissions).

Response

Returns a SlowRequestConnection!

Arguments
Name Description
after - String Opaque pagnination cursor.

Example

Query
query slowRequests($after: String) {
  slowRequests(after: $after) {
    nodes {
      ...SlowRequestFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{"after": "xyz789"}
Response
{
  "data": {
    "slowRequests": {
      "nodes": [SlowRequest],
      "totalCount": 123,
      "pageInfo": PageInfo
    }
  }
}

snippetAttribution

Description

EXPERIMENTAL: Searches the instances indexed code for code matching snippet.

Response

Returns a SnippetAttributionConnection!

Arguments
Name Description
snippet - String!
first - Int

Example

Query
query snippetAttribution(
  $snippet: String!,
  $first: Int
) {
  snippetAttribution(
    snippet: $snippet,
    first: $first
  ) {
    totalCount
    limitHit
    snippetThreshold {
      ...AttributionSnippetThresholdFragment
    }
    pageInfo {
      ...PageInfoFragment
    }
    nodes {
      ...SnippetAttributionFragment
    }
  }
}
Variables
{"snippet": "xyz789", "first": 987}
Response
{
  "data": {
    "snippetAttribution": {
      "totalCount": 123,
      "limitHit": true,
      "snippetThreshold": AttributionSnippetThreshold,
      "pageInfo": PageInfo,
      "nodes": [SnippetAttribution]
    }
  }
}

statusMessages

Description

FOR INTERNAL USE ONLY: Lists all status messages

Response

Returns [StatusMessage!]!

Example

Query
query statusMessages {
  statusMessages {
    ... on GitUpdatesDisabled {
      ...GitUpdatesDisabledFragment
    }
    ... on NoRepositoriesDetected {
      ...NoRepositoriesDetectedFragment
    }
    ... on CloningProgress {
      ...CloningProgressFragment
    }
    ... on ExternalServiceSyncError {
      ...ExternalServiceSyncErrorFragment
    }
    ... on SyncError {
      ...SyncErrorFragment
    }
    ... on IndexingProgress {
      ...IndexingProgressFragment
    }
    ... on GitserverDiskThresholdReached {
      ...GitserverDiskThresholdReachedFragment
    }
  }
}
Response
{"data": {"statusMessages": [GitUpdatesDisabled]}}

surveyResponses

Description

Retrieve responses to surveys.

Response

Returns a SurveyResponseConnection!

Arguments
Name Description
first - Int Returns the first n survey responses from the list.

Example

Query
query surveyResponses($first: Int) {
  surveyResponses(first: $first) {
    nodes {
      ...SurveyResponseFragment
    }
    totalCount
    last30DaysCount
    averageScore
    netPromoterScore
  }
}
Variables
{"first": 123}
Response
{
  "data": {
    "surveyResponses": {
      "nodes": [SurveyResponse],
      "totalCount": 123,
      "last30DaysCount": 123,
      "averageScore": 987.65,
      "netPromoterScore": 987
    }
  }
}

team

Description

Get a single team by name. Returns null if not found.

Response

Returns a Team

Arguments
Name Description
name - String!

Example

Query
query team($name: String!) {
  team(name: $name) {
    id
    name
    url
    avatarURL
    displayName
    readonly
    members {
      ...TeamMemberConnectionFragment
    }
    parentTeam {
      ...TeamFragment
    }
    childTeams {
      ...TeamConnectionFragment
    }
    viewerCanAdminister
    creator {
      ...UserFragment
    }
    external
  }
}
Variables
{"name": "xyz789"}
Response
{
  "data": {
    "team": {
      "id": 4,
      "name": "abc123",
      "url": "abc123",
      "avatarURL": "xyz789",
      "displayName": "abc123",
      "readonly": false,
      "members": TeamMemberConnection,
      "parentTeam": Team,
      "childTeams": TeamConnection,
      "viewerCanAdminister": true,
      "creator": User,
      "external": false
    }
  }
}

teams

Description

Get the global list of all root teams. (Those without a parent team).

Response

Returns a TeamConnection!

Arguments
Name Description
first - Int Returns the first n teams from the list.
after - String Opaque pagination cursor.
search - String Search can be used to do a text-search over the team names.
exceptAncestor - ID Do not include any teams that have this ancestor in parent-team relationship. This includes the team with the ID mentioned (that is a team is considered its own ancestor).
includeChildTeams - Boolean If set to true, child teams (ones that have parent set) are also returned. If not specified, the default behavior is to only include top-level teams.

Example

Query
query teams(
  $first: Int,
  $after: String,
  $search: String,
  $exceptAncestor: ID,
  $includeChildTeams: Boolean
) {
  teams(
    first: $first,
    after: $after,
    search: $search,
    exceptAncestor: $exceptAncestor,
    includeChildTeams: $includeChildTeams
  ) {
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
    nodes {
      ...TeamFragment
    }
  }
}
Variables
{
  "first": 987,
  "after": "abc123",
  "search": "abc123",
  "exceptAncestor": "4",
  "includeChildTeams": false
}
Response
{
  "data": {
    "teams": {
      "totalCount": 123,
      "pageInfo": PageInfo,
      "nodes": [Team]
    }
  }
}

telemetry

Description

Telemetry queries for "Event Logging Everywhere", aka a version 2 of existing event-logging/event-recording APIs.

Response

Returns a TelemetryQuery!

Example

Query
query telemetry {
  telemetry {
    exportedEvents {
      ...ExportedEventsConnectionFragment
    }
  }
}
Response
{
  "data": {
    "telemetry": {
      "exportedEvents": ExportedEventsConnection
    }
  }
}

temporarySettings

Description

Retrieves the temporary settings for the current user.

Response

Returns a TemporarySettings!

Example

Query
query temporarySettings {
  temporarySettings {
    contents
  }
}
Response
{
  "data": {
    "temporarySettings": {
      "contents": "abc123"
    }
  }
}

user

Description

Looks up a user by username or email address.

Response

Returns a User

Arguments
Name Description
username - String Query the user by username.
email - String Query the user by verified email address.

Example

Query
query user(
  $username: String,
  $email: String
) {
  user(
    username: $username,
    email: $email
  ) {
    executorSecrets {
      ...ExecutorSecretConnectionFragment
    }
    id
    username
    email
    displayName
    avatarURL
    url
    settingsURL
    createdAt
    updatedAt
    siteAdmin
    builtinAuth
    latestSettings {
      ...SettingsFragment
    }
    settingsCascade {
      ...SettingsCascadeFragment
    }
    configurationCascade {
      ...ConfigurationCascadeFragment
    }
    organizations {
      ...OrgConnectionFragment
    }
    organizationMemberships {
      ...OrganizationMembershipConnectionFragment
    }
    tosAccepted
    usageStatistics {
      ...UserUsageStatisticsFragment
    }
    eventLogs {
      ...EventLogsConnectionFragment
    }
    emails {
      ...UserEmailFragment
    }
    hasVerifiedEmail
    completedPostSignup
    primaryEmail {
      ...UserEmailFragment
    }
    accessTokens {
      ...AccessTokenConnectionFragment
    }
    externalAccounts {
      ...ExternalAccountConnectionFragment
    }
    session {
      ...SessionFragment
    }
    viewerCanAdminister
    viewerCanChangeUsername
    surveyResponses {
      ...SurveyResponseFragment
    }
    databaseID
    namespaceName
    scimControlled
    roles {
      ...RoleConnectionFragment
    }
    permissions {
      ...PermissionConnectionFragment
    }
    completionsQuotaOverride
    codeCompletionsQuotaOverride
    codySubscription {
      ...CodySubscriptionFragment
    }
    codyProEnabled
    codyCurrentPeriodChatUsage
    codyCurrentPeriodCodeUsage
    codyCurrentPeriodChatLimit
    codyCurrentPeriodCodeLimit
    teams {
      ...TeamConnectionFragment
    }
    batchChanges {
      ...BatchChangeConnectionFragment
    }
    batchChangesCodeHosts {
      ...BatchChangesCodeHostConnectionFragment
    }
  }
}
Variables
{
  "username": "abc123",
  "email": "xyz789"
}
Response
{
  "data": {
    "user": {
      "executorSecrets": ExecutorSecretConnection,
      "id": 4,
      "username": "xyz789",
      "email": "abc123",
      "displayName": "abc123",
      "avatarURL": "xyz789",
      "url": "abc123",
      "settingsURL": "abc123",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "siteAdmin": true,
      "builtinAuth": false,
      "latestSettings": Settings,
      "settingsCascade": SettingsCascade,
      "configurationCascade": ConfigurationCascade,
      "organizations": OrgConnection,
      "organizationMemberships": OrganizationMembershipConnection,
      "tosAccepted": true,
      "usageStatistics": UserUsageStatistics,
      "eventLogs": EventLogsConnection,
      "emails": [UserEmail],
      "hasVerifiedEmail": false,
      "completedPostSignup": false,
      "primaryEmail": UserEmail,
      "accessTokens": AccessTokenConnection,
      "externalAccounts": ExternalAccountConnection,
      "session": Session,
      "viewerCanAdminister": true,
      "viewerCanChangeUsername": false,
      "surveyResponses": [SurveyResponse],
      "databaseID": 123,
      "namespaceName": "xyz789",
      "scimControlled": true,
      "roles": RoleConnection,
      "permissions": PermissionConnection,
      "completionsQuotaOverride": 123,
      "codeCompletionsQuotaOverride": 123,
      "codySubscription": CodySubscription,
      "codyProEnabled": true,
      "codyCurrentPeriodChatUsage": 123,
      "codyCurrentPeriodCodeUsage": 123,
      "codyCurrentPeriodChatLimit": 123,
      "codyCurrentPeriodCodeLimit": 987,
      "teams": TeamConnection,
      "batchChanges": BatchChangeConnection,
      "batchChangesCodeHosts": BatchChangesCodeHostConnection
    }
  }
}

users

Description

List all users.

Response

Returns a UserConnection!

Arguments
Name Description
first - Int Returns the first n users from the list.
after - String Opaque pagination cursor.
query - String Return users whose usernames or display names match the query.
activePeriod - UserActivePeriod Returns users who have been active in a given period of time.
inactiveSince - DateTime Returns users who have NOT been active since a given point in time.

Example

Query
query users(
  $first: Int,
  $after: String,
  $query: String,
  $activePeriod: UserActivePeriod,
  $inactiveSince: DateTime
) {
  users(
    first: $first,
    after: $after,
    query: $query,
    activePeriod: $activePeriod,
    inactiveSince: $inactiveSince
  ) {
    nodes {
      ...UserFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "first": 123,
  "after": "xyz789",
  "query": "abc123",
  "activePeriod": "TODAY",
  "inactiveSince": "2007-12-03T10:15:30Z"
}
Response
{
  "data": {
    "users": {
      "nodes": [User],
      "totalCount": 987,
      "pageInfo": PageInfo
    }
  }
}

validateScopedInsightQuery

Description

Validates a query for determining insight scope and returns the number of repositories it matches for the caller.

Response

Returns a ScopedInsightQueryPayload!

Arguments
Name Description
query - String!

Example

Query
query validateScopedInsightQuery($query: String!) {
  validateScopedInsightQuery(query: $query) {
    query
    isValid
    invalidReason
  }
}
Variables
{"query": "xyz789"}
Response
{
  "data": {
    "validateScopedInsightQuery": {
      "query": "xyz789",
      "isValid": true,
      "invalidReason": "xyz789"
    }
  }
}

validateSearchJob

Description

EXPERIMENTAL: Validate a search job.

Response

Returns an EmptyResponse

Arguments
Name Description
query - String! The query to validate.

Example

Query
query validateSearchJob($query: String!) {
  validateSearchJob(query: $query) {
    alwaysNil
  }
}
Variables
{"query": "xyz789"}
Response
{
  "data": {
    "validateSearchJob": {
      "alwaysNil": "xyz789"
    }
  }
}

viewerConfiguration

use viewerSettings instead
Description

DEPRECATED

Response

Returns a ConfigurationCascade!

Example

Query
query viewerConfiguration {
  viewerConfiguration {
    subjects {
      ...SettingsSubjectFragment
    }
    merged {
      ...ConfigurationFragment
    }
  }
}
Response
{
  "data": {
    "viewerConfiguration": {
      "subjects": [SettingsSubject],
      "merged": Configuration
    }
  }
}

viewerSettings

Description

The settings for the viewer. The viewer is either an anonymous visitor (in which case viewer settings is global settings) or an authenticated user (in which case viewer settings are the user's settings).

Response

Returns a SettingsCascade!

Example

Query
query viewerSettings {
  viewerSettings {
    subjects {
      ...SettingsSubjectFragment
    }
    final
    merged {
      ...ConfigurationFragment
    }
  }
}
Response
{
  "data": {
    "viewerSettings": {
      "subjects": [SettingsSubject],
      "final": "xyz789",
      "merged": Configuration
    }
  }
}

vulnerabilities

Description

Return known vulnerabilities.

Response

Returns a VulnerabilityConnection!

Arguments
Name Description
first - Int The maximum number of results to return.
after - String If supplied, indicates which results to skip over during pagination.

Example

Query
query vulnerabilities(
  $first: Int,
  $after: String
) {
  vulnerabilities(
    first: $first,
    after: $after
  ) {
    nodes {
      ...VulnerabilityFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{"first": 987, "after": "abc123"}
Response
{
  "data": {
    "vulnerabilities": {
      "nodes": [Vulnerability],
      "totalCount": 123,
      "pageInfo": PageInfo
    }
  }
}

vulnerabilityMatches

Description

Return known vulnerability matches.

Response

Returns a VulnerabilityMatchConnection!

Arguments
Name Description
first - Int The maximum number of results to return.
after - String If supplied, indicates which results to skip over during pagination.
language - String Programming language of the vulnerability.
severity - String Severity of the vulnerability.
repositoryName - String The name of the repository to filter by.

Example

Query
query vulnerabilityMatches(
  $first: Int,
  $after: String,
  $language: String,
  $severity: String,
  $repositoryName: String
) {
  vulnerabilityMatches(
    first: $first,
    after: $after,
    language: $language,
    severity: $severity,
    repositoryName: $repositoryName
  ) {
    nodes {
      ...VulnerabilityMatchFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "first": 123,
  "after": "xyz789",
  "language": "abc123",
  "severity": "xyz789",
  "repositoryName": "abc123"
}
Response
{
  "data": {
    "vulnerabilityMatches": {
      "nodes": [VulnerabilityMatch],
      "totalCount": 987,
      "pageInfo": PageInfo
    }
  }
}

vulnerabilityMatchesCountByRepository

Description

Return known vulnerability matches grouped by repository.

Arguments
Name Description
first - Int The maximum number of results to return.
after - String If supplied, indicates which results to skip over during pagination.
repositoryName - String A string pattern that could match the name of a repository.

Example

Query
query vulnerabilityMatchesCountByRepository(
  $first: Int,
  $after: String,
  $repositoryName: String
) {
  vulnerabilityMatchesCountByRepository(
    first: $first,
    after: $after,
    repositoryName: $repositoryName
  ) {
    nodes {
      ...VulnerabilityMatchCountByRepositoryFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "first": 987,
  "after": "xyz789",
  "repositoryName": "xyz789"
}
Response
{
  "data": {
    "vulnerabilityMatchesCountByRepository": {
      "nodes": [VulnerabilityMatchCountByRepository],
      "totalCount": 123,
      "pageInfo": PageInfo
    }
  }
}

vulnerabilityMatchesSummaryCounts

Description

Returns a count of the vulnerability matches grouped by severity.

Example

Query
query vulnerabilityMatchesSummaryCounts {
  vulnerabilityMatchesSummaryCounts {
    critical
    high
    medium
    low
    repository
  }
}
Response
{
  "data": {
    "vulnerabilityMatchesSummaryCounts": {
      "critical": 987,
      "high": 123,
      "medium": 987,
      "low": 123,
      "repository": 123
    }
  }
}

webhookLogs

Description

Returns recently received webhooks across all external services, optionally limiting the returned values to only those that didn't match any external service.

Only site admins can access this field.

Response

Returns a WebhookLogConnection!

Arguments
Name Description
first - Int Returns the first n webhook logs.
after - String Opaque pagination cursor.
onlyErrors - Boolean Only include webhook logs that resulted in errors.
onlyUnmatched - Boolean Only include webhook logs that were not matched to an external service.
since - DateTime Only include webhook logs on or after this time.
until - DateTime Only include webhook logs on or before this time.
webhookID - ID Only include webhook logs of given webhook ID.
legacyOnly - Boolean Only include webhook logs that have no webhook ID set.

Example

Query
query webhookLogs(
  $first: Int,
  $after: String,
  $onlyErrors: Boolean,
  $onlyUnmatched: Boolean,
  $since: DateTime,
  $until: DateTime,
  $webhookID: ID,
  $legacyOnly: Boolean
) {
  webhookLogs(
    first: $first,
    after: $after,
    onlyErrors: $onlyErrors,
    onlyUnmatched: $onlyUnmatched,
    since: $since,
    until: $until,
    webhookID: $webhookID,
    legacyOnly: $legacyOnly
  ) {
    nodes {
      ...WebhookLogFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "first": 987,
  "after": "xyz789",
  "onlyErrors": false,
  "onlyUnmatched": false,
  "since": "2007-12-03T10:15:30Z",
  "until": "2007-12-03T10:15:30Z",
  "webhookID": "4",
  "legacyOnly": true
}
Response
{
  "data": {
    "webhookLogs": {
      "nodes": [WebhookLog],
      "totalCount": 123,
      "pageInfo": PageInfo
    }
  }
}

webhooks

Description

Lists webhooks. Only available to site admins. If no kind is given, it returns all webhooks. If first is omitted, 20 items are returned

Response

Returns a WebhookConnection!

Arguments
Name Description
first - Int Returns the first n webhooks from the list.
after - String Opaque pagination cursor.
kind - ExternalServiceKind Optionally filter by kind.

Example

Query
query webhooks(
  $first: Int,
  $after: String,
  $kind: ExternalServiceKind
) {
  webhooks(
    first: $first,
    after: $after,
    kind: $kind
  ) {
    nodes {
      ...WebhookFragment
    }
    totalCount
    pageInfo {
      ...PageInfoFragment
    }
  }
}
Variables
{
  "first": 123,
  "after": "xyz789",
  "kind": "AWSCODECOMMIT"
}
Response
{
  "data": {
    "webhooks": {
      "nodes": [Webhook],
      "totalCount": 123,
      "pageInfo": PageInfo
    }
  }
}

Mutations

addCodeownersFile

Description

addCodeownersFile creates a new Codeowners file for the given repository and file contents.

Response

Returns a CodeownersIngestedFile!

Arguments
Name Description
input - CodeownersFileInput!

Example

Query
mutation addCodeownersFile($input: CodeownersFileInput!) {
  addCodeownersFile(input: $input) {
    id
    contents
    repository {
      ...RepositoryFragment
    }
    createdAt
    updatedAt
  }
}
Variables
{"input": CodeownersFileInput}
Response
{
  "data": {
    "addCodeownersFile": {
      "id": 4,
      "contents": "xyz789",
      "repository": Repository,
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z"
    }
  }
}

addExternalAccount

Description

Adds an external account to the authenticated user's account. The service type and service ID must correspond to a valid auth provider on the site. The account details must be a stringified JSON object that contains valid credentials for the provided service type.

Response

Returns an EmptyResponse!

Arguments
Name Description
serviceType - String!
serviceID - String!
accountDetails - String!

Example

Query
mutation addExternalAccount(
  $serviceType: String!,
  $serviceID: String!,
  $accountDetails: String!
) {
  addExternalAccount(
    serviceType: $serviceType,
    serviceID: $serviceID,
    accountDetails: $accountDetails
  ) {
    alwaysNil
  }
}
Variables
{
  "serviceType": "xyz789",
  "serviceID": "abc123",
  "accountDetails": "abc123"
}
Response
{
  "data": {
    "addExternalAccount": {
      "alwaysNil": "abc123"
    }
  }
}

addExternalService

Description

Adds a external service. Only site admins may perform this mutation.

Response

Returns an ExternalService!

Arguments
Name Description
input - AddExternalServiceInput!

Example

Query
mutation addExternalService($input: AddExternalServiceInput!) {
  addExternalService(input: $input) {
    id
    kind
    displayName
    rateLimiterState {
      ...RateLimiterStateFragment
    }
    config
    createdAt
    updatedAt
    repoCount
    webhookURL
    warning
    lastSyncError
    lastSyncAt
    nextSyncAt
    creator {
      ...UserFragment
    }
    lastUpdater {
      ...UserFragment
    }
    webhookLogs {
      ...WebhookLogConnectionFragment
    }
    syncJobs {
      ...ExternalServiceSyncJobConnectionFragment
    }
    checkConnection {
      ... on ExternalServiceAvailable {
        ...ExternalServiceAvailableFragment
      }
      ... on ExternalServiceUnavailable {
        ...ExternalServiceUnavailableFragment
      }
      ... on ExternalServiceAvailabilityUnknown {
        ...ExternalServiceAvailabilityUnknownFragment
      }
    }
    hasConnectionCheck
    supportsRepoExclusion
    unrestricted
  }
}
Variables
{"input": AddExternalServiceInput}
Response
{
  "data": {
    "addExternalService": {
      "id": "4",
      "kind": "AWSCODECOMMIT",
      "displayName": "xyz789",
      "rateLimiterState": RateLimiterState,
      "config": JSONCString,
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "repoCount": 123,
      "webhookURL": "xyz789",
      "warning": "abc123",
      "lastSyncError": "abc123",
      "lastSyncAt": "2007-12-03T10:15:30Z",
      "nextSyncAt": "2007-12-03T10:15:30Z",
      "creator": User,
      "lastUpdater": User,
      "webhookLogs": WebhookLogConnection,
      "syncJobs": ExternalServiceSyncJobConnection,
      "checkConnection": ExternalServiceAvailable,
      "hasConnectionCheck": true,
      "supportsRepoExclusion": false,
      "unrestricted": true
    }
  }
}

addInsightViewToDashboard

Description

Associate an existing insight view with this dashboard.

Response

Returns an InsightsDashboardPayload!

Arguments
Name Description
input - AddInsightViewToDashboardInput!

Example

Query
mutation addInsightViewToDashboard($input: AddInsightViewToDashboardInput!) {
  addInsightViewToDashboard(input: $input) {
    dashboard {
      ...InsightsDashboardFragment
    }
  }
}
Variables
{"input": AddInsightViewToDashboardInput}
Response
{
  "data": {
    "addInsightViewToDashboard": {
      "dashboard": InsightsDashboard
    }
  }
}

addPackageRepoFilter

Description

Create a new package repo reference filter.

Response

Returns a PackageFilter!

Arguments
Name Description
behaviour - PackageMatchBehaviour! Whether the matcher should be for allowlisting or blocklisting.
kind - PackageRepoReferenceKind! The ecosystem of the package repo reference this matcher should apply to. Maps to the external service whos config would be updated when used in the set query.
filter - PackageVersionOrNameFilterInput! The package repo reference matcher to persist.

Example

Query
mutation addPackageRepoFilter(
  $behaviour: PackageMatchBehaviour!,
  $kind: PackageRepoReferenceKind!,
  $filter: PackageVersionOrNameFilterInput!
) {
  addPackageRepoFilter(
    behaviour: $behaviour,
    kind: $kind,
    filter: $filter
  ) {
    id
    behaviour
    kind
    nameFilter {
      ...PackageNameFilterFragment
    }
    versionFilter {
      ...PackageVersionFilterFragment
    }
  }
}
Variables
{
  "behaviour": "BLOCK",
  "kind": "GOMODULES",
  "filter": PackageVersionOrNameFilterInput
}
Response
{
  "data": {
    "addPackageRepoFilter": {
      "id": 4,
      "behaviour": "BLOCK",
      "kind": "GOMODULES",
      "nameFilter": PackageNameFilter,
      "versionFilter": PackageVersionFilter
    }
  }
}

addPhabricatorRepo

Description

Adds a Phabricator repository to Sourcegraph.

Response

Returns an EmptyResponse

Arguments
Name Description
callsign - String! The callsign, for example "MUX".
name - String The name, for example "github.com/gorilla/mux".
uri - String An alias for name. DEPRECATED: use name instead.
url - String! The URL to the phabricator instance (e.g. http://phabricator.sgdev.org).

Example

Query
mutation addPhabricatorRepo(
  $callsign: String!,
  $name: String,
  $uri: String,
  $url: String!
) {
  addPhabricatorRepo(
    callsign: $callsign,
    name: $name,
    uri: $uri,
    url: $url
  ) {
    alwaysNil
  }
}
Variables
{
  "callsign": "abc123",
  "name": "abc123",
  "uri": "abc123",
  "url": "xyz789"
}
Response
{
  "data": {
    "addPhabricatorRepo": {
      "alwaysNil": "abc123"
    }
  }
}

addRepoKeyValuePair

Use addRepoMetadata instead. This field is a deprecated and will be removed in a future release.
Description

Associate a new key-value pair with a repo.

Response

Returns an EmptyResponse!

Arguments
Name Description
repo - ID!
key - String!
value - String

Example

Query
mutation addRepoKeyValuePair(
  $repo: ID!,
  $key: String!,
  $value: String
) {
  addRepoKeyValuePair(
    repo: $repo,
    key: $key,
    value: $value
  ) {
    alwaysNil
  }
}
Variables
{
  "repo": "4",
  "key": "abc123",
  "value": "abc123"
}
Response
{
  "data": {
    "addRepoKeyValuePair": {
      "alwaysNil": "abc123"
    }
  }
}

addRepoMetadata

Description

Associate a new key-value pair metadata with a repo.

Response

Returns an EmptyResponse!

Arguments
Name Description
repo - ID!
key - String!
value - String

Example

Query
mutation addRepoMetadata(
  $repo: ID!,
  $key: String!,
  $value: String
) {
  addRepoMetadata(
    repo: $repo,
    key: $key,
    value: $value
  ) {
    alwaysNil
  }
}
Variables
{
  "repo": "4",
  "key": "xyz789",
  "value": "abc123"
}
Response
{
  "data": {
    "addRepoMetadata": {
      "alwaysNil": "abc123"
    }
  }
}

addTeamMembers

Description

Add a list of team members to an existing team. People that already are part of the team are ignored.

Either team XOR teamName can be specified to specify the team. Must be team member to add new team members, or site-admin.

For now, members can only be the IDs of User entities in Sourcegraph. Later, we will expand this to allow Persons as well.

If skipUnmatchedMembers is true, members that are not matched to a user are skipped.

Response

Returns a Team!

Arguments
Name Description
team - ID
teamName - String
members - [TeamMemberInput!]!
skipUnmatchedMembers - Boolean Default = false

Example

Query
mutation addTeamMembers(
  $team: ID,
  $teamName: String,
  $members: [TeamMemberInput!]!,
  $skipUnmatchedMembers: Boolean
) {
  addTeamMembers(
    team: $team,
    teamName: $teamName,
    members: $members,
    skipUnmatchedMembers: $skipUnmatchedMembers
  ) {
    id
    name
    url
    avatarURL
    displayName
    readonly
    members {
      ...TeamMemberConnectionFragment
    }
    parentTeam {
      ...TeamFragment
    }
    childTeams {
      ...TeamConnectionFragment
    }
    viewerCanAdminister
    creator {
      ...UserFragment
    }
    external
  }
}
Variables
{
  "team": "4",
  "teamName": "xyz789",
  "members": [TeamMemberInput],
  "skipUnmatchedMembers": false
}
Response
{
  "data": {
    "addTeamMembers": {
      "id": 4,
      "name": "xyz789",
      "url": "abc123",
      "avatarURL": "xyz789",
      "displayName": "xyz789",
      "readonly": true,
      "members": TeamMemberConnection,
      "parentTeam": Team,
      "childTeams": TeamConnection,
      "viewerCanAdminister": false,
      "creator": User,
      "external": true
    }
  }
}

addUserEmail

Description

Adds an email address to the user's account. The email address will be marked as unverified until the user has followed the email verification process.

Only the user and site admins may perform this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
user - ID!
email - String!

Example

Query
mutation addUserEmail(
  $user: ID!,
  $email: String!
) {
  addUserEmail(
    user: $user,
    email: $email
  ) {
    alwaysNil
  }
}
Variables
{"user": 4, "email": "xyz789"}
Response
{
  "data": {
    "addUserEmail": {"alwaysNil": "xyz789"}
  }
}

addUserToOrganization

Description

Immediately add a user as a member to the organization, without sending an invitation email.

Only site admins may perform this mutation. Organization members may use the inviteUserToOrganization mutation to invite users.

Response

Returns an EmptyResponse!

Arguments
Name Description
organization - ID!
username - String!

Example

Query
mutation addUserToOrganization(
  $organization: ID!,
  $username: String!
) {
  addUserToOrganization(
    organization: $organization,
    username: $username
  ) {
    alwaysNil
  }
}
Variables
{
  "organization": "4",
  "username": "abc123"
}
Response
{
  "data": {
    "addUserToOrganization": {
      "alwaysNil": "xyz789"
    }
  }
}

applyBatchChange

Description

Create or update a batch change from a batch spec and locally computed changeset specs. If no batch change exists in the namespace with the name given in the batch spec, a batch change will be created. Otherwise, the existing batch change will be updated. The batch change is returned. Closed batch changes cannot be applied to. In that case, an error with the error code ErrApplyClosedbatch change will be returned.

Response

Returns a BatchChange!

Arguments
Name Description
batchSpec - ID! The batch spec that describes the new desired state of the batch change. It must be in COMPLETED state.
ensureBatchChange - ID If set, return an error if the batch change identified using the namespace and batch changeSpec parameters does not match the batch change with this ID. This lets callers use a stable ID that refers to a specific batch change during an edit session (and is not susceptible to conflicts if the underlying batch change is moved to a different namespace, renamed, or deleted). The returned error has the error code ErrEnsureBatchChangeFailed.
publicationStates - [ChangesetSpecPublicationStateInput!]

If set, these changeset specs will have their UI publication states set to the given values. This will overwrite any existing UI publication states on the changesets.

An error will be returned if the same changeset spec ID is included more than once in the array, or if a changeset spec ID is included with a publication state set in its spec.

Example

Query
mutation applyBatchChange(
  $batchSpec: ID!,
  $ensureBatchChange: ID,
  $publicationStates: [ChangesetSpecPublicationStateInput!]
) {
  applyBatchChange(
    batchSpec: $batchSpec,
    ensureBatchChange: $ensureBatchChange,
    publicationStates: $publicationStates
  ) {
    id
    namespace {
      ...NamespaceFragment
    }
    name
    description
    state
    creator {
      ...UserFragment
    }
    lastApplier {
      ...UserFragment
    }
    viewerCanAdminister
    url
    createdAt
    updatedAt
    lastAppliedAt
    closedAt
    changesetsStats {
      ...ChangesetsStatsFragment
    }
    changesets {
      ...ChangesetConnectionFragment
    }
    changesetCountsOverTime {
      ...ChangesetCountsFragment
    }
    diffStat {
      ...DiffStatFragment
    }
    currentSpec {
      ...BatchSpecFragment
    }
    bulkOperations {
      ...BulkOperationConnectionFragment
    }
    batchSpecs {
      ...BatchSpecConnectionFragment
    }
  }
}
Variables
{
  "batchSpec": "4",
  "ensureBatchChange": 4,
  "publicationStates": [
    ChangesetSpecPublicationStateInput
  ]
}
Response
{
  "data": {
    "applyBatchChange": {
      "id": "4",
      "namespace": Namespace,
      "name": "xyz789",
      "description": "abc123",
      "state": "OPEN",
      "creator": User,
      "lastApplier": User,
      "viewerCanAdminister": false,
      "url": "abc123",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "lastAppliedAt": "2007-12-03T10:15:30Z",
      "closedAt": "2007-12-03T10:15:30Z",
      "changesetsStats": ChangesetsStats,
      "changesets": ChangesetConnection,
      "changesetCountsOverTime": [ChangesetCounts],
      "diffStat": DiffStat,
      "currentSpec": BatchSpec,
      "bulkOperations": BulkOperationConnection,
      "batchSpecs": BatchSpecConnection
    }
  }
}

assignOwner

Description

assignOwner creates a new assigned owner.

Response

Returns an EmptyResponse

Arguments
Name Description
input - AssignOwnerOrTeamInput!

Example

Query
mutation assignOwner($input: AssignOwnerOrTeamInput!) {
  assignOwner(input: $input) {
    alwaysNil
  }
}
Variables
{"input": AssignOwnerOrTeamInput}
Response
{
  "data": {
    "assignOwner": {"alwaysNil": "abc123"}
  }
}

assignTeam

Description

assignTeam creates a new assigned team.

Response

Returns an EmptyResponse

Arguments
Name Description
input - AssignOwnerOrTeamInput!

Example

Query
mutation assignTeam($input: AssignOwnerOrTeamInput!) {
  assignTeam(input: $input) {
    alwaysNil
  }
}
Variables
{"input": AssignOwnerOrTeamInput}
Response
{
  "data": {
    "assignTeam": {"alwaysNil": "abc123"}
  }
}

bumpDerivativeGraphKey

Description

Effectively begins a new ranking map/reduce job.

Response

Returns an EmptyResponse!

Example

Query
mutation bumpDerivativeGraphKey {
  bumpDerivativeGraphKey {
    alwaysNil
  }
}
Response
{
  "data": {
    "bumpDerivativeGraphKey": {
      "alwaysNil": "abc123"
    }
  }
}

cancelBatchSpecExecution

Description

Attempts to cancel the execution of the given batch spec. All workspace jobs that are QUEUED or PROCESSING will be cancelled. The execution must not have completed yet.

Response

Returns a BatchSpec!

Arguments
Name Description
batchSpec - ID!

Example

Query
mutation cancelBatchSpecExecution($batchSpec: ID!) {
  cancelBatchSpecExecution(batchSpec: $batchSpec) {
    id
    autoApplyEnabled
    state
    originalInput
    parsedInput
    description {
      ...BatchChangeDescriptionFragment
    }
    applyPreview {
      ...ChangesetApplyPreviewConnectionFragment
    }
    changesetSpecs {
      ...ChangesetSpecConnectionFragment
    }
    creator {
      ...UserFragment
    }
    createdAt
    startedAt
    finishedAt
    namespace {
      ...NamespaceFragment
    }
    expiresAt
    applyURL
    viewerCanAdminister
    diffStat {
      ...DiffStatFragment
    }
    appliesToBatchChange {
      ...BatchChangeFragment
    }
    supersedingBatchSpec {
      ...BatchSpecFragment
    }
    viewerBatchChangesCodeHosts {
      ...BatchChangesCodeHostConnectionFragment
    }
    workspaceResolution {
      ...BatchSpecWorkspaceResolutionFragment
    }
    importingChangesets {
      ...ChangesetSpecConnectionFragment
    }
    failureMessage
    allowIgnored
    allowUnsupported
    noCache
    viewerCanRetry
    source
    files {
      ...BatchSpecWorkspaceFileConnectionFragment
    }
  }
}
Variables
{"batchSpec": 4}
Response
{
  "data": {
    "cancelBatchSpecExecution": {
      "id": 4,
      "autoApplyEnabled": true,
      "state": "PENDING",
      "originalInput": "xyz789",
      "parsedInput": JSONValue,
      "description": BatchChangeDescription,
      "applyPreview": ChangesetApplyPreviewConnection,
      "changesetSpecs": ChangesetSpecConnection,
      "creator": User,
      "createdAt": "2007-12-03T10:15:30Z",
      "startedAt": "2007-12-03T10:15:30Z",
      "finishedAt": "2007-12-03T10:15:30Z",
      "namespace": Namespace,
      "expiresAt": "2007-12-03T10:15:30Z",
      "applyURL": "abc123",
      "viewerCanAdminister": true,
      "diffStat": DiffStat,
      "appliesToBatchChange": BatchChange,
      "supersedingBatchSpec": BatchSpec,
      "viewerBatchChangesCodeHosts": BatchChangesCodeHostConnection,
      "workspaceResolution": BatchSpecWorkspaceResolution,
      "importingChangesets": ChangesetSpecConnection,
      "failureMessage": "xyz789",
      "allowIgnored": true,
      "allowUnsupported": false,
      "noCache": false,
      "viewerCanRetry": true,
      "source": "LOCAL",
      "files": BatchSpecWorkspaceFileConnection
    }
  }
}

cancelBatchSpecWorkspaceExecution

Description

Cancel a single workspace execution. Mostly useful in the "try out" UI, but can also be used at later stages. Must be in PROCESSING or QUEUED state.

Response

Returns an EmptyResponse!

Arguments
Name Description
batchSpecWorkspaces - [ID!]!

Example

Query
mutation cancelBatchSpecWorkspaceExecution($batchSpecWorkspaces: [ID!]!) {
  cancelBatchSpecWorkspaceExecution(batchSpecWorkspaces: $batchSpecWorkspaces) {
    alwaysNil
  }
}
Variables
{"batchSpecWorkspaces": ["4"]}
Response
{
  "data": {
    "cancelBatchSpecWorkspaceExecution": {
      "alwaysNil": "abc123"
    }
  }
}

cancelExternalServiceSync

Description

Cancels an external service sync job. Must be in queued or processing state.

Site-admin or owner of the external service only.

Response

Returns an EmptyResponse!

Arguments
Name Description
id - ID!

Example

Query
mutation cancelExternalServiceSync($id: ID!) {
  cancelExternalServiceSync(id: $id) {
    alwaysNil
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "cancelExternalServiceSync": {
      "alwaysNil": "abc123"
    }
  }
}

cancelRepoEmbeddingJob

Description

Experimental: Cancels the embedding job with the given ID. The job must exist and be in either 'processing' or 'queued' state.

Response

Returns an EmptyResponse!

Arguments
Name Description
job - ID!

Example

Query
mutation cancelRepoEmbeddingJob($job: ID!) {
  cancelRepoEmbeddingJob(job: $job) {
    alwaysNil
  }
}
Variables
{"job": 4}
Response
{
  "data": {
    "cancelRepoEmbeddingJob": {
      "alwaysNil": "xyz789"
    }
  }
}

cancelSearchJob

Description

EXPERIMENTAL: Cancel a search job. This will cancel all of the search's repositories and revisions.

Response

Returns an EmptyResponse

Arguments
Name Description
id - ID! The ID of the search job to cancel.

Example

Query
mutation cancelSearchJob($id: ID!) {
  cancelSearchJob(id: $id) {
    alwaysNil
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "cancelSearchJob": {
      "alwaysNil": "abc123"
    }
  }
}

changeCodyPlan

Description

Updates the user's Self-serve Cody plan to Free or Pro.

Only the user may perform this mutation.

Response

Returns a User!

Arguments
Name Description
user - ID!
pro - Boolean!

Example

Query
mutation changeCodyPlan(
  $user: ID!,
  $pro: Boolean!
) {
  changeCodyPlan(
    user: $user,
    pro: $pro
  ) {
    executorSecrets {
      ...ExecutorSecretConnectionFragment
    }
    id
    username
    email
    displayName
    avatarURL
    url
    settingsURL
    createdAt
    updatedAt
    siteAdmin
    builtinAuth
    latestSettings {
      ...SettingsFragment
    }
    settingsCascade {
      ...SettingsCascadeFragment
    }
    configurationCascade {
      ...ConfigurationCascadeFragment
    }
    organizations {
      ...OrgConnectionFragment
    }
    organizationMemberships {
      ...OrganizationMembershipConnectionFragment
    }
    tosAccepted
    usageStatistics {
      ...UserUsageStatisticsFragment
    }
    eventLogs {
      ...EventLogsConnectionFragment
    }
    emails {
      ...UserEmailFragment
    }
    hasVerifiedEmail
    completedPostSignup
    primaryEmail {
      ...UserEmailFragment
    }
    accessTokens {
      ...AccessTokenConnectionFragment
    }
    externalAccounts {
      ...ExternalAccountConnectionFragment
    }
    session {
      ...SessionFragment
    }
    viewerCanAdminister
    viewerCanChangeUsername
    surveyResponses {
      ...SurveyResponseFragment
    }
    databaseID
    namespaceName
    scimControlled
    roles {
      ...RoleConnectionFragment
    }
    permissions {
      ...PermissionConnectionFragment
    }
    completionsQuotaOverride
    codeCompletionsQuotaOverride
    codySubscription {
      ...CodySubscriptionFragment
    }
    codyProEnabled
    codyCurrentPeriodChatUsage
    codyCurrentPeriodCodeUsage
    codyCurrentPeriodChatLimit
    codyCurrentPeriodCodeLimit
    teams {
      ...TeamConnectionFragment
    }
    batchChanges {
      ...BatchChangeConnectionFragment
    }
    batchChangesCodeHosts {
      ...BatchChangesCodeHostConnectionFragment
    }
  }
}
Variables
{"user": 4, "pro": false}
Response
{
  "data": {
    "changeCodyPlan": {
      "executorSecrets": ExecutorSecretConnection,
      "id": "4",
      "username": "abc123",
      "email": "abc123",
      "displayName": "xyz789",
      "avatarURL": "xyz789",
      "url": "xyz789",
      "settingsURL": "abc123",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "siteAdmin": true,
      "builtinAuth": false,
      "latestSettings": Settings,
      "settingsCascade": SettingsCascade,
      "configurationCascade": ConfigurationCascade,
      "organizations": OrgConnection,
      "organizationMemberships": OrganizationMembershipConnection,
      "tosAccepted": false,
      "usageStatistics": UserUsageStatistics,
      "eventLogs": EventLogsConnection,
      "emails": [UserEmail],
      "hasVerifiedEmail": true,
      "completedPostSignup": false,
      "primaryEmail": UserEmail,
      "accessTokens": AccessTokenConnection,
      "externalAccounts": ExternalAccountConnection,
      "session": Session,
      "viewerCanAdminister": true,
      "viewerCanChangeUsername": false,
      "surveyResponses": [SurveyResponse],
      "databaseID": 987,
      "namespaceName": "xyz789",
      "scimControlled": false,
      "roles": RoleConnection,
      "permissions": PermissionConnection,
      "completionsQuotaOverride": 987,
      "codeCompletionsQuotaOverride": 123,
      "codySubscription": CodySubscription,
      "codyProEnabled": false,
      "codyCurrentPeriodChatUsage": 123,
      "codyCurrentPeriodCodeUsage": 987,
      "codyCurrentPeriodChatLimit": 987,
      "codyCurrentPeriodCodeLimit": 987,
      "teams": TeamConnection,
      "batchChanges": BatchChangeConnection,
      "batchChangesCodeHosts": BatchChangesCodeHostConnection
    }
  }
}

checkMirrorRepositoryConnection

Description

Tests the connection to a mirror repository's original source repository. This is an expensive and slow operation, so it should only be used for interactive diagnostics.

Only site admins may perform this mutation.

Arguments
Name Description
repository - ID! The ID of the existing repository whose mirror to check.

Example

Query
mutation checkMirrorRepositoryConnection($repository: ID!) {
  checkMirrorRepositoryConnection(repository: $repository) {
    error
  }
}
Variables
{"repository": "4"}
Response
{
  "data": {
    "checkMirrorRepositoryConnection": {
      "error": "xyz789"
    }
  }
}

closeBatchChange

Description

Close a batch change.

Response

Returns a BatchChange!

Arguments
Name Description
batchChange - ID!
closeChangesets - Boolean Whether to close the changesets associated with this batch change on their respective code hosts. "Close" means the appropriate final state on the code host (e.g., "closed" on GitHub and "declined" on Bitbucket Server). Default = false

Example

Query
mutation closeBatchChange(
  $batchChange: ID!,
  $closeChangesets: Boolean
) {
  closeBatchChange(
    batchChange: $batchChange,
    closeChangesets: $closeChangesets
  ) {
    id
    namespace {
      ...NamespaceFragment
    }
    name
    description
    state
    creator {
      ...UserFragment
    }
    lastApplier {
      ...UserFragment
    }
    viewerCanAdminister
    url
    createdAt
    updatedAt
    lastAppliedAt
    closedAt
    changesetsStats {
      ...ChangesetsStatsFragment
    }
    changesets {
      ...ChangesetConnectionFragment
    }
    changesetCountsOverTime {
      ...ChangesetCountsFragment
    }
    diffStat {
      ...DiffStatFragment
    }
    currentSpec {
      ...BatchSpecFragment
    }
    bulkOperations {
      ...BulkOperationConnectionFragment
    }
    batchSpecs {
      ...BatchSpecConnectionFragment
    }
  }
}
Variables
{"batchChange": 4, "closeChangesets": false}
Response
{
  "data": {
    "closeBatchChange": {
      "id": 4,
      "namespace": Namespace,
      "name": "abc123",
      "description": "xyz789",
      "state": "OPEN",
      "creator": User,
      "lastApplier": User,
      "viewerCanAdminister": true,
      "url": "xyz789",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "lastAppliedAt": "2007-12-03T10:15:30Z",
      "closedAt": "2007-12-03T10:15:30Z",
      "changesetsStats": ChangesetsStats,
      "changesets": ChangesetConnection,
      "changesetCountsOverTime": [ChangesetCounts],
      "diffStat": DiffStat,
      "currentSpec": BatchSpec,
      "bulkOperations": BulkOperationConnection,
      "batchSpecs": BatchSpecConnection
    }
  }
}

closeChangesets

Description

Close multiple changesets.

Experimental: This API is likely to change in the future.

Response

Returns a BulkOperation!

Arguments
Name Description
batchChange - ID!
changesets - [ID!]!

Example

Query
mutation closeChangesets(
  $batchChange: ID!,
  $changesets: [ID!]!
) {
  closeChangesets(
    batchChange: $batchChange,
    changesets: $changesets
  ) {
    id
    type
    state
    progress
    errors {
      ...ChangesetJobErrorFragment
    }
    createdAt
    finishedAt
    initiator {
      ...UserFragment
    }
    changesetCount
  }
}
Variables
{"batchChange": 4, "changesets": ["4"]}
Response
{
  "data": {
    "closeChangesets": {
      "id": 4,
      "type": "COMMENT",
      "state": "PROCESSING",
      "progress": 987.65,
      "errors": [ChangesetJobError],
      "createdAt": "2007-12-03T10:15:30Z",
      "finishedAt": "2007-12-03T10:15:30Z",
      "initiator": User,
      "changesetCount": 123
    }
  }
}

configurationMutation

use settingsMutation instead
Description

DEPRECATED: Use settingsMutation instead. This field is a deprecated alias for settingsMutation and will be removed in a future release.

Response

Returns a SettingsMutation

Arguments
Name Description
input - SettingsMutationGroupInput!

Example

Query
mutation configurationMutation($input: SettingsMutationGroupInput!) {
  configurationMutation(input: $input) {
    editSettings {
      ...UpdateSettingsPayloadFragment
    }
    editConfiguration {
      ...UpdateSettingsPayloadFragment
    }
    overwriteSettings {
      ...UpdateSettingsPayloadFragment
    }
  }
}
Variables
{"input": SettingsMutationGroupInput}
Response
{
  "data": {
    "configurationMutation": {
      "editSettings": UpdateSettingsPayload,
      "editConfiguration": UpdateSettingsPayload,
      "overwriteSettings": UpdateSettingsPayload
    }
  }
}

createAccessToken

Description

Creates an access token that grants the privileges of the specified user (referred to as the access token's "subject" user after token creation). The result is the access token value, which the caller is responsible for storing (it is not accessible by Sourcegraph after creation).

The supported scopes are:

  • "user:all": Full control of all resources accessible to the user account.
  • "site-admin:sudo": Ability to perform any action as any other user. (Only site admins may create tokens with this scope.)

DurationSeconds: If provided, the number of seconds until the token expires automatically.

Only the user or site admins may perform this mutation.

Response

Returns a CreateAccessTokenResult!

Arguments
Name Description
user - ID!
durationSeconds - Int
scopes - [String!]!
note - String!

Example

Query
mutation createAccessToken(
  $user: ID!,
  $durationSeconds: Int,
  $scopes: [String!]!,
  $note: String!
) {
  createAccessToken(
    user: $user,
    durationSeconds: $durationSeconds,
    scopes: $scopes,
    note: $note
  ) {
    id
    token
  }
}
Variables
{
  "user": "4",
  "durationSeconds": 987,
  "scopes": ["abc123"],
  "note": "xyz789"
}
Response
{
  "data": {
    "createAccessToken": {
      "id": "4",
      "token": "xyz789"
    }
  }
}

createBatchChange

Description

Create a batch change from a batch spec and locally computed changeset specs. The newly created batch change is returned. If a batch change in the same namespace with the same name already exists, an error with the error code ErrMatchingBatchChangeExists is returned.

Response

Returns a BatchChange!

Arguments
Name Description
batchSpec - ID! The batch spec that describes the desired state of the batch change. It must be in COMPLETED state.
publicationStates - [ChangesetSpecPublicationStateInput!]

If set, these changeset specs will have their UI publication states set to the given values.

An error will be returned if the same changeset spec ID is included more than once in the array, or if a changeset spec ID is included with a publication state set in its spec.

Example

Query
mutation createBatchChange(
  $batchSpec: ID!,
  $publicationStates: [ChangesetSpecPublicationStateInput!]
) {
  createBatchChange(
    batchSpec: $batchSpec,
    publicationStates: $publicationStates
  ) {
    id
    namespace {
      ...NamespaceFragment
    }
    name
    description
    state
    creator {
      ...UserFragment
    }
    lastApplier {
      ...UserFragment
    }
    viewerCanAdminister
    url
    createdAt
    updatedAt
    lastAppliedAt
    closedAt
    changesetsStats {
      ...ChangesetsStatsFragment
    }
    changesets {
      ...ChangesetConnectionFragment
    }
    changesetCountsOverTime {
      ...ChangesetCountsFragment
    }
    diffStat {
      ...DiffStatFragment
    }
    currentSpec {
      ...BatchSpecFragment
    }
    bulkOperations {
      ...BulkOperationConnectionFragment
    }
    batchSpecs {
      ...BatchSpecConnectionFragment
    }
  }
}
Variables
{
  "batchSpec": 4,
  "publicationStates": [
    ChangesetSpecPublicationStateInput
  ]
}
Response
{
  "data": {
    "createBatchChange": {
      "id": "4",
      "namespace": Namespace,
      "name": "abc123",
      "description": "xyz789",
      "state": "OPEN",
      "creator": User,
      "lastApplier": User,
      "viewerCanAdminister": false,
      "url": "abc123",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "lastAppliedAt": "2007-12-03T10:15:30Z",
      "closedAt": "2007-12-03T10:15:30Z",
      "changesetsStats": ChangesetsStats,
      "changesets": ChangesetConnection,
      "changesetCountsOverTime": [ChangesetCounts],
      "diffStat": DiffStat,
      "currentSpec": BatchSpec,
      "bulkOperations": BulkOperationConnection,
      "batchSpecs": BatchSpecConnection
    }
  }
}

createBatchChangesCredential

Description

Create a new credential for the given user for the given code host. If another token for that code host already exists, an error with the error code ErrDuplicateCredential is returned.

Response

Returns a BatchChangesCredential!

Arguments
Name Description
user - ID The user for which to create the credential. If null is provided, a site-wide credential is created.
externalServiceKind - ExternalServiceKind! The kind of external service being configured.
externalServiceURL - String! The URL of the external service being configured.
username - String The username associated with the credential, if required by the external service kind.
credential - String! The credential to be stored. This can never be retrieved through the API and will be stored encrypted.

Example

Query
mutation createBatchChangesCredential(
  $user: ID,
  $externalServiceKind: ExternalServiceKind!,
  $externalServiceURL: String!,
  $username: String,
  $credential: String!
) {
  createBatchChangesCredential(
    user: $user,
    externalServiceKind: $externalServiceKind,
    externalServiceURL: $externalServiceURL,
    username: $username,
    credential: $credential
  ) {
    id
    externalServiceKind
    externalServiceURL
    sshPublicKey
    createdAt
    isSiteCredential
  }
}
Variables
{
  "user": 4,
  "externalServiceKind": "AWSCODECOMMIT",
  "externalServiceURL": "xyz789",
  "username": "xyz789",
  "credential": "xyz789"
}
Response
{
  "data": {
    "createBatchChangesCredential": {
      "id": 4,
      "externalServiceKind": "AWSCODECOMMIT",
      "externalServiceURL": "xyz789",
      "sshPublicKey": "xyz789",
      "createdAt": "2007-12-03T10:15:30Z",
      "isSiteCredential": false
    }
  }
}

createBatchSpec

Description

Create a batch spec that will be used to create a batch change (with the createBatchChange mutation), or to update an existing batch change (with the applyBatchChange mutation).

The returned BatchSpec is immutable and expires after a certain period of time (if not used in a call to applyBatchChange), which can be queried on BatchSpec.expiresAt.

If batch changes are unlicensed and the number of changesetSpecIDs is higher than what's allowed in the free tier, an error with the error code ErrBatchChangesUnlicensed is returned.

Response

Returns a BatchSpec!

Arguments
Name Description
namespace - ID! The namespace (either a user or organization). A batch spec can only be applied to (or used to create) batch changes in this namespace.
batchSpec - String! The batch spec as YAML (or the equivalent JSON). See https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/schema/batch_spec.schema.json for the JSON Schema that describes the structure of this input.
changesetSpecs - [ID!]! Changeset specs that were locally computed and then uploaded using createChangesetSpec.

Example

Query
mutation createBatchSpec(
  $namespace: ID!,
  $batchSpec: String!,
  $changesetSpecs: [ID!]!
) {
  createBatchSpec(
    namespace: $namespace,
    batchSpec: $batchSpec,
    changesetSpecs: $changesetSpecs
  ) {
    id
    autoApplyEnabled
    state
    originalInput
    parsedInput
    description {
      ...BatchChangeDescriptionFragment
    }
    applyPreview {
      ...ChangesetApplyPreviewConnectionFragment
    }
    changesetSpecs {
      ...ChangesetSpecConnectionFragment
    }
    creator {
      ...UserFragment
    }
    createdAt
    startedAt
    finishedAt
    namespace {
      ...NamespaceFragment
    }
    expiresAt
    applyURL
    viewerCanAdminister
    diffStat {
      ...DiffStatFragment
    }
    appliesToBatchChange {
      ...BatchChangeFragment
    }
    supersedingBatchSpec {
      ...BatchSpecFragment
    }
    viewerBatchChangesCodeHosts {
      ...BatchChangesCodeHostConnectionFragment
    }
    workspaceResolution {
      ...BatchSpecWorkspaceResolutionFragment
    }
    importingChangesets {
      ...ChangesetSpecConnectionFragment
    }
    failureMessage
    allowIgnored
    allowUnsupported
    noCache
    viewerCanRetry
    source
    files {
      ...BatchSpecWorkspaceFileConnectionFragment
    }
  }
}
Variables
{
  "namespace": 4,
  "batchSpec": "xyz789",
  "changesetSpecs": ["4"]
}
Response
{
  "data": {
    "createBatchSpec": {
      "id": 4,
      "autoApplyEnabled": false,
      "state": "PENDING",
      "originalInput": "xyz789",
      "parsedInput": JSONValue,
      "description": BatchChangeDescription,
      "applyPreview": ChangesetApplyPreviewConnection,
      "changesetSpecs": ChangesetSpecConnection,
      "creator": User,
      "createdAt": "2007-12-03T10:15:30Z",
      "startedAt": "2007-12-03T10:15:30Z",
      "finishedAt": "2007-12-03T10:15:30Z",
      "namespace": Namespace,
      "expiresAt": "2007-12-03T10:15:30Z",
      "applyURL": "abc123",
      "viewerCanAdminister": false,
      "diffStat": DiffStat,
      "appliesToBatchChange": BatchChange,
      "supersedingBatchSpec": BatchSpec,
      "viewerBatchChangesCodeHosts": BatchChangesCodeHostConnection,
      "workspaceResolution": BatchSpecWorkspaceResolution,
      "importingChangesets": ChangesetSpecConnection,
      "failureMessage": "abc123",
      "allowIgnored": false,
      "allowUnsupported": false,
      "noCache": true,
      "viewerCanRetry": true,
      "source": "LOCAL",
      "files": BatchSpecWorkspaceFileConnection
    }
  }
}

createBatchSpecFromRaw

Description

Creates a batch spec and triggers a job to evaluate the workspaces. Consumers need to poll the batch spec until the resolution is completed to get a full list of all workspaces. This might become streaming so the results will come in over time.

This mutation should be used when updating an existing batch change whose previous batch spec was already applied. When the previous batch spec was not yet applied, you can use replaceBatchSpecInput instead.

Response

Returns a BatchSpec!

Arguments
Name Description
batchSpec - String! The raw batch spec as YAML (or the equivalent JSON). See https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/schema/batch_spec.schema.json for the JSON Schema that describes the structure of this input.
allowIgnored - Boolean If true, repos with a .batchignore file will still be included. Default = false
allowUnsupported - Boolean If true, repos on unsupported codehosts will be included. Resulting changesets in these repos cannot be published. Default = false
execute - Boolean

Right away set the execute flag.

TODO: Not implemented yet. Default = false

noCache - Boolean Don't use cache entries. Default = false
namespace - ID! The namespace (either a user or organization). A batch spec can only be applied to (or used to create) batch changes in this namespace.
batchChange - ID! The batch change this batch spec is associated with.

Example

Query
mutation createBatchSpecFromRaw(
  $batchSpec: String!,
  $allowIgnored: Boolean,
  $allowUnsupported: Boolean,
  $execute: Boolean,
  $noCache: Boolean,
  $namespace: ID!,
  $batchChange: ID!
) {
  createBatchSpecFromRaw(
    batchSpec: $batchSpec,
    allowIgnored: $allowIgnored,
    allowUnsupported: $allowUnsupported,
    execute: $execute,
    noCache: $noCache,
    namespace: $namespace,
    batchChange: $batchChange
  ) {
    id
    autoApplyEnabled
    state
    originalInput
    parsedInput
    description {
      ...BatchChangeDescriptionFragment
    }
    applyPreview {
      ...ChangesetApplyPreviewConnectionFragment
    }
    changesetSpecs {
      ...ChangesetSpecConnectionFragment
    }
    creator {
      ...UserFragment
    }
    createdAt
    startedAt
    finishedAt
    namespace {
      ...NamespaceFragment
    }
    expiresAt
    applyURL
    viewerCanAdminister
    diffStat {
      ...DiffStatFragment
    }
    appliesToBatchChange {
      ...BatchChangeFragment
    }
    supersedingBatchSpec {
      ...BatchSpecFragment
    }
    viewerBatchChangesCodeHosts {
      ...BatchChangesCodeHostConnectionFragment
    }
    workspaceResolution {
      ...BatchSpecWorkspaceResolutionFragment
    }
    importingChangesets {
      ...ChangesetSpecConnectionFragment
    }
    failureMessage
    allowIgnored
    allowUnsupported
    noCache
    viewerCanRetry
    source
    files {
      ...BatchSpecWorkspaceFileConnectionFragment
    }
  }
}
Variables
{
  "batchSpec": "xyz789",
  "allowIgnored": false,
  "allowUnsupported": false,
  "execute": false,
  "noCache": false,
  "namespace": 4,
  "batchChange": 4
}
Response
{
  "data": {
    "createBatchSpecFromRaw": {
      "id": "4",
      "autoApplyEnabled": true,
      "state": "PENDING",
      "originalInput": "xyz789",
      "parsedInput": JSONValue,
      "description": BatchChangeDescription,
      "applyPreview": ChangesetApplyPreviewConnection,
      "changesetSpecs": ChangesetSpecConnection,
      "creator": User,
      "createdAt": "2007-12-03T10:15:30Z",
      "startedAt": "2007-12-03T10:15:30Z",
      "finishedAt": "2007-12-03T10:15:30Z",
      "namespace": Namespace,
      "expiresAt": "2007-12-03T10:15:30Z",
      "applyURL": "xyz789",
      "viewerCanAdminister": true,
      "diffStat": DiffStat,
      "appliesToBatchChange": BatchChange,
      "supersedingBatchSpec": BatchSpec,
      "viewerBatchChangesCodeHosts": BatchChangesCodeHostConnection,
      "workspaceResolution": BatchSpecWorkspaceResolution,
      "importingChangesets": ChangesetSpecConnection,
      "failureMessage": "xyz789",
      "allowIgnored": true,
      "allowUnsupported": true,
      "noCache": false,
      "viewerCanRetry": false,
      "source": "LOCAL",
      "files": BatchSpecWorkspaceFileConnection
    }
  }
}

createChangesetComments

Description

Comment on multiple changesets from a batch change.

Experimental: This API is likely to change in the future.

Response

Returns a BulkOperation!

Arguments
Name Description
batchChange - ID!
changesets - [ID!]!
body - String!

Example

Query
mutation createChangesetComments(
  $batchChange: ID!,
  $changesets: [ID!]!,
  $body: String!
) {
  createChangesetComments(
    batchChange: $batchChange,
    changesets: $changesets,
    body: $body
  ) {
    id
    type
    state
    progress
    errors {
      ...ChangesetJobErrorFragment
    }
    createdAt
    finishedAt
    initiator {
      ...UserFragment
    }
    changesetCount
  }
}
Variables
{
  "batchChange": 4,
  "changesets": [4],
  "body": "abc123"
}
Response
{
  "data": {
    "createChangesetComments": {
      "id": 4,
      "type": "COMMENT",
      "state": "PROCESSING",
      "progress": 987.65,
      "errors": [ChangesetJobError],
      "createdAt": "2007-12-03T10:15:30Z",
      "finishedAt": "2007-12-03T10:15:30Z",
      "initiator": User,
      "changesetCount": 123
    }
  }
}

createChangesetSpec

Description

Upload a changeset spec that will be used in a future update to a batch change. The changeset spec is stored and can be referenced by its ID in the applyBatchChange mutation. Just uploading the changeset spec does not result in changes to the batch change or any of its changesets; you need to call applyBatchChange to use it.

You can use this mutation to upload large changeset specs (e.g., containing large diffs) in individual HTTP requests. Then, in the eventual applyBatchChange call, you just refer to the changeset specs by their IDs. This lets you avoid problems when updating large batch changes where a large HTTP request body (e.g., with many large diffs in the changeset specs) would be rejected by the web server/proxy or would be very slow.

The returned ChangesetSpec is immutable and expires after a certain period of time (if not used in a call to applyBatchChange), which can be queried on ChangesetSpec.expiresAt.

Response

Returns a ChangesetSpec!

Arguments
Name Description
changesetSpec - String! The raw changeset spec (as JSON). See https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/schema/changeset_spec.schema.json for the JSON Schema that describes the structure of this input.

Example

Query
mutation createChangesetSpec($changesetSpec: String!) {
  createChangesetSpec(changesetSpec: $changesetSpec) {
    id
    type
    expiresAt
  }
}
Variables
{"changesetSpec": "xyz789"}
Response
{
  "data": {
    "createChangesetSpec": {
      "id": 4,
      "type": "EXISTING",
      "expiresAt": "2007-12-03T10:15:30Z"
    }
  }
}

createChangesetSpecs

Description

FOR INTERNAL USE ONLY.

Upload multiple changeset specs that will be used in a future update to a batch change. The changeset specs are stored and can be referenced by their ID in the applyBatchChange mutation. Just uploading the changeset specs does not result in changes to the batch change or any of its changesets; you need to call applyBatchChange to use it.

The returned ChangesetSpecs is immutable and expires after a certain period of time (if not used in a call to applyBatchChange), which can be queried on ChangesetSpec.expiresAt.

Response

Returns [ChangesetSpec!]!

Arguments
Name Description
changesetSpecs - [String!]! The raw changeset specs (as JSON). See https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/schema/changeset_spec.schema.json for the JSON Schema that describes the structure of this input.

Example

Query
mutation createChangesetSpecs($changesetSpecs: [String!]!) {
  createChangesetSpecs(changesetSpecs: $changesetSpecs) {
    id
    type
    expiresAt
  }
}
Variables
{"changesetSpecs": ["abc123"]}
Response
{
  "data": {
    "createChangesetSpecs": [
      {
        "id": 4,
        "type": "EXISTING",
        "expiresAt": "2007-12-03T10:15:30Z"
      }
    ]
  }
}

createCodeIntelligenceConfigurationPolicy

Description

Creates a new configuration policy with the given attributes.

Arguments
Name Description
repository - ID If supplied, the repository to which this configuration policy applies. If not supplied, this configuration policy is applied to all repositories.
repositoryPatterns - [String!] If supplied, the name patterns matching repositories to which this configuration policy applies. This option is mutually exclusive with an explicit repository.
name - String!
type - GitObjectType!
pattern - String!
retentionEnabled - Boolean!
retentionDurationHours - Int
retainIntermediateCommits - Boolean!
indexingEnabled - Boolean!
indexCommitMaxAgeHours - Int
indexIntermediateCommits - Boolean!
embeddingsEnabled - Boolean embeddingsEnabled, if not provided, currently defaults to false.

Example

Query
mutation createCodeIntelligenceConfigurationPolicy(
  $repository: ID,
  $repositoryPatterns: [String!],
  $name: String!,
  $type: GitObjectType!,
  $pattern: String!,
  $retentionEnabled: Boolean!,
  $retentionDurationHours: Int,
  $retainIntermediateCommits: Boolean!,
  $indexingEnabled: Boolean!,
  $indexCommitMaxAgeHours: Int,
  $indexIntermediateCommits: Boolean!,
  $embeddingsEnabled: Boolean
) {
  createCodeIntelligenceConfigurationPolicy(
    repository: $repository,
    repositoryPatterns: $repositoryPatterns,
    name: $name,
    type: $type,
    pattern: $pattern,
    retentionEnabled: $retentionEnabled,
    retentionDurationHours: $retentionDurationHours,
    retainIntermediateCommits: $retainIntermediateCommits,
    indexingEnabled: $indexingEnabled,
    indexCommitMaxAgeHours: $indexCommitMaxAgeHours,
    indexIntermediateCommits: $indexIntermediateCommits,
    embeddingsEnabled: $embeddingsEnabled
  ) {
    id
    name
    repository {
      ...CodeIntelRepositoryFragment
    }
    repositoryPatterns
    type
    pattern
    protected
    retentionEnabled
    retentionDurationHours
    retainIntermediateCommits
    indexingEnabled
    indexCommitMaxAgeHours
    indexIntermediateCommits
    embeddingsEnabled
  }
}
Variables
{
  "repository": "4",
  "repositoryPatterns": ["abc123"],
  "name": "abc123",
  "type": "GIT_COMMIT",
  "pattern": "xyz789",
  "retentionEnabled": false,
  "retentionDurationHours": 123,
  "retainIntermediateCommits": true,
  "indexingEnabled": true,
  "indexCommitMaxAgeHours": 123,
  "indexIntermediateCommits": true,
  "embeddingsEnabled": false
}
Response
{
  "data": {
    "createCodeIntelligenceConfigurationPolicy": {
      "id": "4",
      "name": "xyz789",
      "repository": CodeIntelRepository,
      "repositoryPatterns": ["abc123"],
      "type": "GIT_COMMIT",
      "pattern": "abc123",
      "protected": true,
      "retentionEnabled": true,
      "retentionDurationHours": 987,
      "retainIntermediateCommits": false,
      "indexingEnabled": true,
      "indexCommitMaxAgeHours": 123,
      "indexIntermediateCommits": false,
      "embeddingsEnabled": false
    }
  }
}

createEmptyBatchChange

Description

Creates a batch change with an empty batch spec, such as for drafting a new batch change. The user creating the batch change must have permission to create it in the namespace provided. Use createBatchSpecFromRaw and replaceBatchSpecInput to update the input batch spec after creating.

Response

Returns a BatchChange!

Arguments
Name Description
namespace - ID! The namespace (either a user or organization) that this batch change should belong to.
name - String! The (unique) name to identify the batch change by in its namespace.

Example

Query
mutation createEmptyBatchChange(
  $namespace: ID!,
  $name: String!
) {
  createEmptyBatchChange(
    namespace: $namespace,
    name: $name
  ) {
    id
    namespace {
      ...NamespaceFragment
    }
    name
    description
    state
    creator {
      ...UserFragment
    }
    lastApplier {
      ...UserFragment
    }
    viewerCanAdminister
    url
    createdAt
    updatedAt
    lastAppliedAt
    closedAt
    changesetsStats {
      ...ChangesetsStatsFragment
    }
    changesets {
      ...ChangesetConnectionFragment
    }
    changesetCountsOverTime {
      ...ChangesetCountsFragment
    }
    diffStat {
      ...DiffStatFragment
    }
    currentSpec {
      ...BatchSpecFragment
    }
    bulkOperations {
      ...BulkOperationConnectionFragment
    }
    batchSpecs {
      ...BatchSpecConnectionFragment
    }
  }
}
Variables
{"namespace": 4, "name": "xyz789"}
Response
{
  "data": {
    "createEmptyBatchChange": {
      "id": "4",
      "namespace": Namespace,
      "name": "xyz789",
      "description": "xyz789",
      "state": "OPEN",
      "creator": User,
      "lastApplier": User,
      "viewerCanAdminister": true,
      "url": "xyz789",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "lastAppliedAt": "2007-12-03T10:15:30Z",
      "closedAt": "2007-12-03T10:15:30Z",
      "changesetsStats": ChangesetsStats,
      "changesets": ChangesetConnection,
      "changesetCountsOverTime": [ChangesetCounts],
      "diffStat": DiffStat,
      "currentSpec": BatchSpec,
      "bulkOperations": BulkOperationConnection,
      "batchSpecs": BatchSpecConnection
    }
  }
}

createExecutorSecret

Description

Create a new executor secret. See argument descriptions for more details.

Response

Returns an ExecutorSecret!

Arguments
Name Description
scope - ExecutorSecretScope! The scope for which the secret is usable.
key - String! The key under which the secret is known. For executions, this is the name of the environment variable this secret will be accessible under. It is therefore advised that key only contains uppercase letters, numbers and underscores.
value - String! The secret value.
namespace - ID The namespace this secret is for. If not set, a global secret is created that is accessible by all users. Creating a global secret requires site-admin permissions. Creating a namespaced secret requires write-access to the namespace.

Example

Query
mutation createExecutorSecret(
  $scope: ExecutorSecretScope!,
  $key: String!,
  $value: String!,
  $namespace: ID
) {
  createExecutorSecret(
    scope: $scope,
    key: $key,
    value: $value,
    namespace: $namespace
  ) {
    id
    key
    scope
    overwritesGlobalSecret
    namespace {
      ...NamespaceFragment
    }
    creator {
      ...UserFragment
    }
    createdAt
    updatedAt
    accessLogs {
      ...ExecutorSecretAccessLogConnectionFragment
    }
  }
}
Variables
{
  "scope": "BATCHES",
  "key": "xyz789",
  "value": "abc123",
  "namespace": 4
}
Response
{
  "data": {
    "createExecutorSecret": {
      "id": "4",
      "key": "xyz789",
      "scope": "BATCHES",
      "overwritesGlobalSecret": true,
      "namespace": Namespace,
      "creator": User,
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "accessLogs": ExecutorSecretAccessLogConnection
    }
  }
}

createFeatureFlag

Description

EXPERIMENTAL: Create a new feature flag

Response

Returns a FeatureFlag!

Arguments
Name Description
name - String! The name of the feature flag
value - Boolean The value of the feature flag. Only set if the new feature flag will be a concrete boolean flag. Mutually exclusive with rolloutBasisPoints.
rolloutBasisPoints - Int The ratio of users the feature flag will apply to, expressed in basis points (0.01%). Only set if the new feature flag will be a rollout flag. Mutually exclusive with value.

Example

Query
mutation createFeatureFlag(
  $name: String!,
  $value: Boolean,
  $rolloutBasisPoints: Int
) {
  createFeatureFlag(
    name: $name,
    value: $value,
    rolloutBasisPoints: $rolloutBasisPoints
  ) {
    ... on FeatureFlagBoolean {
      ...FeatureFlagBooleanFragment
    }
    ... on FeatureFlagRollout {
      ...FeatureFlagRolloutFragment
    }
  }
}
Variables
{
  "name": "abc123",
  "value": false,
  "rolloutBasisPoints": 987
}
Response
{"data": {"createFeatureFlag": FeatureFlagBoolean}}

createFeatureFlagOverride

Description

EXPERIMENTAL: Create a new feature flag override for the given org or user

Response

Returns a FeatureFlagOverride!

Arguments
Name Description
namespace - ID! The namespace for this feature flag. Must be either a user ID or an org ID.
flagName - String! The name of the feature flag this override applies to
value - Boolean! The overridden value

Example

Query
mutation createFeatureFlagOverride(
  $namespace: ID!,
  $flagName: String!,
  $value: Boolean!
) {
  createFeatureFlagOverride(
    namespace: $namespace,
    flagName: $flagName,
    value: $value
  ) {
    id
    namespace {
      ...NamespaceFragment
    }
    targetFlag {
      ... on FeatureFlagBoolean {
        ...FeatureFlagBooleanFragment
      }
      ... on FeatureFlagRollout {
        ...FeatureFlagRolloutFragment
      }
    }
    value
  }
}
Variables
{
  "namespace": "4",
  "flagName": "xyz789",
  "value": true
}
Response
{
  "data": {
    "createFeatureFlagOverride": {
      "id": 4,
      "namespace": Namespace,
      "targetFlag": FeatureFlagBoolean,
      "value": false
    }
  }
}

createInsightsDashboard

Description

Create a new dashboard.

Response

Returns an InsightsDashboardPayload!

Arguments
Name Description
input - CreateInsightsDashboardInput!

Example

Query
mutation createInsightsDashboard($input: CreateInsightsDashboardInput!) {
  createInsightsDashboard(input: $input) {
    dashboard {
      ...InsightsDashboardFragment
    }
  }
}
Variables
{"input": CreateInsightsDashboardInput}
Response
{
  "data": {
    "createInsightsDashboard": {
      "dashboard": InsightsDashboard
    }
  }
}

createLineChartSearchInsight

Description

Create a line chart backed by search insights.

Response

Returns an InsightViewPayload!

Arguments
Name Description
input - LineChartSearchInsightInput!

Example

Query
mutation createLineChartSearchInsight($input: LineChartSearchInsightInput!) {
  createLineChartSearchInsight(input: $input) {
    view {
      ...InsightViewFragment
    }
  }
}
Variables
{"input": LineChartSearchInsightInput}
Response
{
  "data": {
    "createLineChartSearchInsight": {"view": InsightView}
  }
}

createNotebook

Description

Create a notebook.

Response

Returns a Notebook!

Arguments
Name Description
notebook - NotebookInput! Notebook input.

Example

Query
mutation createNotebook($notebook: NotebookInput!) {
  createNotebook(notebook: $notebook) {
    id
    title
    blocks {
      ... on MarkdownBlock {
        ...MarkdownBlockFragment
      }
      ... on QueryBlock {
        ...QueryBlockFragment
      }
      ... on FileBlock {
        ...FileBlockFragment
      }
      ... on SymbolBlock {
        ...SymbolBlockFragment
      }
    }
    creator {
      ...UserFragment
    }
    updater {
      ...UserFragment
    }
    namespace {
      ...NamespaceFragment
    }
    public
    updatedAt
    createdAt
    viewerCanManage
    viewerHasStarred
    stars {
      ...NotebookStarConnectionFragment
    }
  }
}
Variables
{"notebook": NotebookInput}
Response
{
  "data": {
    "createNotebook": {
      "id": 4,
      "title": "abc123",
      "blocks": [MarkdownBlock],
      "creator": User,
      "updater": User,
      "namespace": Namespace,
      "public": true,
      "updatedAt": "2007-12-03T10:15:30Z",
      "createdAt": "2007-12-03T10:15:30Z",
      "viewerCanManage": false,
      "viewerHasStarred": false,
      "stars": NotebookStarConnection
    }
  }
}

createNotebookStar

Description

Create a notebook star for the current user. Only one star can be created per notebook and user pair.

Response

Returns a NotebookStar!

Arguments
Name Description
notebookID - ID!

Example

Query
mutation createNotebookStar($notebookID: ID!) {
  createNotebookStar(notebookID: $notebookID) {
    user {
      ...UserFragment
    }
    createdAt
  }
}
Variables
{"notebookID": 4}
Response
{
  "data": {
    "createNotebookStar": {
      "user": User,
      "createdAt": "2007-12-03T10:15:30Z"
    }
  }
}

createOrganization

Description

Creates an organization. The caller is added as a member of the newly created organization.

Only authenticated users may perform this mutation.

Response

Returns an Org!

Arguments
Name Description
name - String!
displayName - String
statsID - ID

Example

Query
mutation createOrganization(
  $name: String!,
  $displayName: String,
  $statsID: ID
) {
  createOrganization(
    name: $name,
    displayName: $displayName,
    statsID: $statsID
  ) {
    executorSecrets {
      ...ExecutorSecretConnectionFragment
    }
    id
    name
    displayName
    createdAt
    members {
      ...NewUsersConnectionFragment
    }
    latestSettings {
      ...SettingsFragment
    }
    settingsCascade {
      ...SettingsCascadeFragment
    }
    configurationCascade {
      ...ConfigurationCascadeFragment
    }
    viewerPendingInvitation {
      ...OrganizationInvitationFragment
    }
    viewerCanAdminister
    viewerIsMember
    url
    settingsURL
    namespaceName
    batchChanges {
      ...BatchChangeConnectionFragment
    }
  }
}
Variables
{
  "name": "abc123",
  "displayName": "abc123",
  "statsID": 4
}
Response
{
  "data": {
    "createOrganization": {
      "executorSecrets": ExecutorSecretConnection,
      "id": 4,
      "name": "xyz789",
      "displayName": "xyz789",
      "createdAt": "2007-12-03T10:15:30Z",
      "members": NewUsersConnection,
      "latestSettings": Settings,
      "settingsCascade": SettingsCascade,
      "configurationCascade": ConfigurationCascade,
      "viewerPendingInvitation": OrganizationInvitation,
      "viewerCanAdminister": true,
      "viewerIsMember": false,
      "url": "abc123",
      "settingsURL": "abc123",
      "namespaceName": "abc123",
      "batchChanges": BatchChangeConnection
    }
  }
}

createOutboundWebhook

Description

Creates a new outbound webhook.

Only site admins have access to this mutation.

Response

Returns an OutboundWebhook!

Arguments
Name Description
input - OutboundWebhookCreateInput!

Example

Query
mutation createOutboundWebhook($input: OutboundWebhookCreateInput!) {
  createOutboundWebhook(input: $input) {
    id
    url
    eventTypes {
      ...OutboundWebhookScopedEventTypeFragment
    }
    stats {
      ...OutboundWebhookLogStatsFragment
    }
    logs {
      ...OutboundWebhookLogConnectionFragment
    }
  }
}
Variables
{"input": OutboundWebhookCreateInput}
Response
{
  "data": {
    "createOutboundWebhook": {
      "id": 4,
      "url": "abc123",
      "eventTypes": [OutboundWebhookScopedEventType],
      "stats": OutboundWebhookLogStats,
      "logs": OutboundWebhookLogConnection
    }
  }
}

createPassword

Description

Creates a password for the current user. It is only permitted if the user does not have a password.

Response

Returns an EmptyResponse

Arguments
Name Description
newPassword - String!

Example

Query
mutation createPassword($newPassword: String!) {
  createPassword(newPassword: $newPassword) {
    alwaysNil
  }
}
Variables
{"newPassword": "abc123"}
Response
{
  "data": {
    "createPassword": {
      "alwaysNil": "xyz789"
    }
  }
}

createPieChartSearchInsight

Description

Create a pie chart backed by search insights.

Response

Returns an InsightViewPayload!

Arguments
Name Description
input - PieChartSearchInsightInput!

Example

Query
mutation createPieChartSearchInsight($input: PieChartSearchInsightInput!) {
  createPieChartSearchInsight(input: $input) {
    view {
      ...InsightViewFragment
    }
  }
}
Variables
{"input": PieChartSearchInsightInput}
Response
{
  "data": {
    "createPieChartSearchInsight": {"view": InsightView}
  }
}

createRole

Description

Creates a role.

Response

Returns a Role!

Arguments
Name Description
name - String!
permissions - [ID!]!

Example

Query
mutation createRole(
  $name: String!,
  $permissions: [ID!]!
) {
  createRole(
    name: $name,
    permissions: $permissions
  ) {
    id
    name
    system
    permissions {
      ...PermissionConnectionFragment
    }
    createdAt
  }
}
Variables
{
  "name": "abc123",
  "permissions": ["4"]
}
Response
{
  "data": {
    "createRole": {
      "id": "4",
      "name": "abc123",
      "system": false,
      "permissions": PermissionConnection,
      "createdAt": "2007-12-03T10:15:30Z"
    }
  }
}

createSavedSearch

Description

Creates a saved search.

Response

Returns a SavedSearch!

Arguments
Name Description
description - String!
query - String!
notifyOwner - Boolean!
notifySlack - Boolean!
orgID - ID
userID - ID

Example

Query
mutation createSavedSearch(
  $description: String!,
  $query: String!,
  $notifyOwner: Boolean!,
  $notifySlack: Boolean!,
  $orgID: ID,
  $userID: ID
) {
  createSavedSearch(
    description: $description,
    query: $query,
    notifyOwner: $notifyOwner,
    notifySlack: $notifySlack,
    orgID: $orgID,
    userID: $userID
  ) {
    id
    description
    query
    notify
    notifySlack
    namespace {
      ...NamespaceFragment
    }
    slackWebhookURL
  }
}
Variables
{
  "description": "xyz789",
  "query": "xyz789",
  "notifyOwner": false,
  "notifySlack": false,
  "orgID": "4",
  "userID": 4
}
Response
{
  "data": {
    "createSavedSearch": {
      "id": 4,
      "description": "abc123",
      "query": "xyz789",
      "notify": false,
      "notifySlack": true,
      "namespace": Namespace,
      "slackWebhookURL": "abc123"
    }
  }
}

createSearchContext

Description

Create search context.

Response

Returns a SearchContext!

Arguments
Name Description
searchContext - SearchContextInput! Search context input.
repositories - [SearchContextRepositoryRevisionsInput!]! List of search context repository revisions.

Example

Query
mutation createSearchContext(
  $searchContext: SearchContextInput!,
  $repositories: [SearchContextRepositoryRevisionsInput!]!
) {
  createSearchContext(
    searchContext: $searchContext,
    repositories: $repositories
  ) {
    id
    name
    namespace {
      ...NamespaceFragment
    }
    description
    spec
    autoDefined
    query
    repositories {
      ...SearchContextRepositoryRevisionsFragment
    }
    public
    updatedAt
    viewerCanManage
    viewerHasAsDefault
    viewerHasStarred
  }
}
Variables
{
  "searchContext": SearchContextInput,
  "repositories": [SearchContextRepositoryRevisionsInput]
}
Response
{
  "data": {
    "createSearchContext": {
      "id": "4",
      "name": "abc123",
      "namespace": Namespace,
      "description": "abc123",
      "spec": "xyz789",
      "autoDefined": true,
      "query": "abc123",
      "repositories": [SearchContextRepositoryRevisions],
      "public": false,
      "updatedAt": "2007-12-03T10:15:30Z",
      "viewerCanManage": true,
      "viewerHasAsDefault": true,
      "viewerHasStarred": false
    }
  }
}

createSearchContextStar

Description

Add a star on a search context for the specified user. Only one star can be created per context and user pair. If the star already exists, this is a no-op.

Response

Returns an EmptyResponse!

Arguments
Name Description
searchContextID - ID!
userID - ID!

Example

Query
mutation createSearchContextStar(
  $searchContextID: ID!,
  $userID: ID!
) {
  createSearchContextStar(
    searchContextID: $searchContextID,
    userID: $userID
  ) {
    alwaysNil
  }
}
Variables
{"searchContextID": 4, "userID": "4"}
Response
{
  "data": {
    "createSearchContextStar": {
      "alwaysNil": "abc123"
    }
  }
}

createSearchJob

Description

EXPERIMENTAL: Create a new search job. The query will be validated before the search is created.

Response

Returns a SearchJob!

Arguments
Name Description
query - String! The query to run. This must be a valid search query.

Example

Query
mutation createSearchJob($query: String!) {
  createSearchJob(query: $query) {
    id
    query
    state
    creator {
      ...UserFragment
    }
    createdAt
    startedAt
    finishedAt
    URL
    logURL
    repoStats {
      ...SearchJobStatsFragment
    }
  }
}
Variables
{"query": "xyz789"}
Response
{
  "data": {
    "createSearchJob": {
      "id": 4,
      "query": "xyz789",
      "state": "QUEUED",
      "creator": User,
      "createdAt": "2007-12-03T10:15:30Z",
      "startedAt": "2007-12-03T10:15:30Z",
      "finishedAt": "2007-12-03T10:15:30Z",
      "URL": "abc123",
      "logURL": "abc123",
      "repoStats": SearchJobStats
    }
  }
}

createTeam

Description

Creates a team. The name must be unique, display name can be used to set a custom display value for the team inside Sourcegraph.

If readonly is true, the Sourcegraph UI will show a warning banner that this team is managed externally, and it can only be modified by site-admins. This is to prevent state drift from external systems that ingest team information into Sourcegraph. Readonly can only be set by site-admins.

Either parentTeam XOR parentTeamName can be specified to make the team a child team of the given parent. Only members of the parent team or site-admis can create a child team.

Response

Returns a Team!

Arguments
Name Description
name - String!
displayName - String
readonly - Boolean Default = false
parentTeam - ID
parentTeamName - String

Example

Query
mutation createTeam(
  $name: String!,
  $displayName: String,
  $readonly: Boolean,
  $parentTeam: ID,
  $parentTeamName: String
) {
  createTeam(
    name: $name,
    displayName: $displayName,
    readonly: $readonly,
    parentTeam: $parentTeam,
    parentTeamName: $parentTeamName
  ) {
    id
    name
    url
    avatarURL
    displayName
    readonly
    members {
      ...TeamMemberConnectionFragment
    }
    parentTeam {
      ...TeamFragment
    }
    childTeams {
      ...TeamConnectionFragment
    }
    viewerCanAdminister
    creator {
      ...UserFragment
    }
    external
  }
}
Variables
{
  "name": "xyz789",
  "displayName": "abc123",
  "readonly": false,
  "parentTeam": "4",
  "parentTeamName": "xyz789"
}
Response
{
  "data": {
    "createTeam": {
      "id": 4,
      "name": "abc123",
      "url": "abc123",
      "avatarURL": "abc123",
      "displayName": "xyz789",
      "readonly": false,
      "members": TeamMemberConnection,
      "parentTeam": Team,
      "childTeams": TeamConnection,
      "viewerCanAdminister": true,
      "creator": User,
      "external": true
    }
  }
}

createUser

Description

Creates a new user account.

Only site admins may perform this mutation.

Response

Returns a CreateUserResult!

Arguments
Name Description
username - String! The new user's username.
email - String The new user's optional email address. If given, it must be verified by the user.
verifiedEmail - Boolean Whether or not to mark the provided email address as verified. If unset or set to true, then the email address is immediately marked as verified - otherwise, the email may be marked as unverified if SMTP and password resets are enabled.

Example

Query
mutation createUser(
  $username: String!,
  $email: String,
  $verifiedEmail: Boolean
) {
  createUser(
    username: $username,
    email: $email,
    verifiedEmail: $verifiedEmail
  ) {
    user {
      ...UserFragment
    }
    resetPasswordURL
  }
}
Variables
{
  "username": "xyz789",
  "email": "xyz789",
  "verifiedEmail": true
}
Response
{
  "data": {
    "createUser": {
      "user": User,
      "resetPasswordURL": "abc123"
    }
  }
}

createWebhook

Description

Creates a webhook for the specified code host. Only site admins may perform this mutation.

Response

Returns a Webhook!

Arguments
Name Description
name - String!
codeHostKind - String!
codeHostURN - String!
secret - String

Example

Query
mutation createWebhook(
  $name: String!,
  $codeHostKind: String!,
  $codeHostURN: String!,
  $secret: String
) {
  createWebhook(
    name: $name,
    codeHostKind: $codeHostKind,
    codeHostURN: $codeHostURN,
    secret: $secret
  ) {
    id
    uuid
    url
    name
    codeHostKind
    codeHostURN
    secret
    updatedAt
    updatedBy {
      ...UserFragment
    }
    createdAt
    createdBy {
      ...UserFragment
    }
    webhookLogs {
      ...WebhookLogConnectionFragment
    }
  }
}
Variables
{
  "name": "abc123",
  "codeHostKind": "abc123",
  "codeHostURN": "xyz789",
  "secret": "xyz789"
}
Response
{
  "data": {
    "createWebhook": {
      "id": "4",
      "uuid": "abc123",
      "url": "abc123",
      "name": "xyz789",
      "codeHostKind": "AWSCODECOMMIT",
      "codeHostURN": "xyz789",
      "secret": "xyz789",
      "updatedAt": "2007-12-03T10:15:30Z",
      "updatedBy": User,
      "createdAt": "2007-12-03T10:15:30Z",
      "createdBy": User,
      "webhookLogs": WebhookLogConnection
    }
  }
}

deleteAccessToken

Description

Deletes and immediately revokes the specified access token, specified by either its ID or by the token itself.

Only site admins or the user who owns the token may perform this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
byID - ID
byToken - String

Example

Query
mutation deleteAccessToken(
  $byID: ID,
  $byToken: String
) {
  deleteAccessToken(
    byID: $byID,
    byToken: $byToken
  ) {
    alwaysNil
  }
}
Variables
{"byID": 4, "byToken": "xyz789"}
Response
{
  "data": {
    "deleteAccessToken": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteBatchChange

Description

Delete a batch change. A deleted batch change is completely removed and can't be un-deleted. The batch change's changesets are kept as-is; to close them, use the closeBatchChange mutation first.

Response

Returns an EmptyResponse

Arguments
Name Description
batchChange - ID!

Example

Query
mutation deleteBatchChange($batchChange: ID!) {
  deleteBatchChange(batchChange: $batchChange) {
    alwaysNil
  }
}
Variables
{"batchChange": 4}
Response
{
  "data": {
    "deleteBatchChange": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteBatchChangesCredential

Description

Hard-deletes a given credential.

Response

Returns an EmptyResponse!

Arguments
Name Description
batchChangesCredential - ID!

Example

Query
mutation deleteBatchChangesCredential($batchChangesCredential: ID!) {
  deleteBatchChangesCredential(batchChangesCredential: $batchChangesCredential) {
    alwaysNil
  }
}
Variables
{"batchChangesCredential": "4"}
Response
{
  "data": {
    "deleteBatchChangesCredential": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteBatchSpec

Description

Deletes the batch spec. All associated jobs will be canceled, if still running. This is called by the client, whenever a new run is triggered, to support faster cleanups. We will also purge these in the background, but this'll be faster.

Response

Returns an EmptyResponse!

Arguments
Name Description
batchSpec - ID!

Example

Query
mutation deleteBatchSpec($batchSpec: ID!) {
  deleteBatchSpec(batchSpec: $batchSpec) {
    alwaysNil
  }
}
Variables
{"batchSpec": "4"}
Response
{
  "data": {
    "deleteBatchSpec": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteCodeIntelligenceConfigurationPolicy

Description

Deletes the configuration policy with the given identifier.

Response

Returns an EmptyResponse

Arguments
Name Description
policy - ID!

Example

Query
mutation deleteCodeIntelligenceConfigurationPolicy($policy: ID!) {
  deleteCodeIntelligenceConfigurationPolicy(policy: $policy) {
    alwaysNil
  }
}
Variables
{"policy": 4}
Response
{
  "data": {
    "deleteCodeIntelligenceConfigurationPolicy": {
      "alwaysNil": "abc123"
    }
  }
}

deleteCodeownersFiles

Description

deleteCodeownersFiles deletes any existing Codeowners file for the given repositories.

Response

Returns an EmptyResponse

Arguments
Name Description
repositories - [DeleteCodeownersFilesInput!]!

Example

Query
mutation deleteCodeownersFiles($repositories: [DeleteCodeownersFilesInput!]!) {
  deleteCodeownersFiles(repositories: $repositories) {
    alwaysNil
  }
}
Variables
{"repositories": [DeleteCodeownersFilesInput]}
Response
{
  "data": {
    "deleteCodeownersFiles": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteExecutorSecret

Description

Deletes the given executor secret.

Response

Returns an EmptyResponse

Arguments
Name Description
scope - ExecutorSecretScope! The scope of the secret.
id - ID! The identifier of the secret that shall be deleted.

Example

Query
mutation deleteExecutorSecret(
  $scope: ExecutorSecretScope!,
  $id: ID!
) {
  deleteExecutorSecret(
    scope: $scope,
    id: $id
  ) {
    alwaysNil
  }
}
Variables
{"scope": "BATCHES", "id": 4}
Response
{
  "data": {
    "deleteExecutorSecret": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteExternalAccount

Description

Deletes the association between an external account and its Sourcegraph user. It does NOT delete the external account on the external service where it resides.

Only site admins or the user who is associated with the external account may perform this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
externalAccount - ID!

Example

Query
mutation deleteExternalAccount($externalAccount: ID!) {
  deleteExternalAccount(externalAccount: $externalAccount) {
    alwaysNil
  }
}
Variables
{"externalAccount": "4"}
Response
{
  "data": {
    "deleteExternalAccount": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteExternalService

Description

Delete an external service. Only site admins may perform this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
externalService - ID!
async - Boolean Default = false

Example

Query
mutation deleteExternalService(
  $externalService: ID!,
  $async: Boolean
) {
  deleteExternalService(
    externalService: $externalService,
    async: $async
  ) {
    alwaysNil
  }
}
Variables
{"externalService": "4", "async": false}
Response
{
  "data": {
    "deleteExternalService": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteFeatureFlag

Description

EXPERIMENTAL: Delete a feature flag

Response

Returns an EmptyResponse!

Arguments
Name Description
name - String! The name of the feature flag

Example

Query
mutation deleteFeatureFlag($name: String!) {
  deleteFeatureFlag(name: $name) {
    alwaysNil
  }
}
Variables
{"name": "xyz789"}
Response
{
  "data": {
    "deleteFeatureFlag": {
      "alwaysNil": "abc123"
    }
  }
}

deleteFeatureFlagOverride

Description

Delete a feature flag override

Response

Returns an EmptyResponse!

Arguments
Name Description
id - ID! The ID of the feature flag override to delete

Example

Query
mutation deleteFeatureFlagOverride($id: ID!) {
  deleteFeatureFlagOverride(id: $id) {
    alwaysNil
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "deleteFeatureFlagOverride": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteGitHubApp

Description

Delete a GitHub App. The GitHub App, along with all of its associated code host connections and authentication provider, will be deleted.

Response

Returns an EmptyResponse

Arguments
Name Description
gitHubApp - ID!

Example

Query
mutation deleteGitHubApp($gitHubApp: ID!) {
  deleteGitHubApp(gitHubApp: $gitHubApp) {
    alwaysNil
  }
}
Variables
{"gitHubApp": "4"}
Response
{
  "data": {
    "deleteGitHubApp": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteInsightView

Description

Delete an insight view given the graphql ID.

Response

Returns an EmptyResponse!

Arguments
Name Description
id - ID!

Example

Query
mutation deleteInsightView($id: ID!) {
  deleteInsightView(id: $id) {
    alwaysNil
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "deleteInsightView": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteInsightsDashboard

Description

Delete a dashboard.

Response

Returns an EmptyResponse!

Arguments
Name Description
id - ID!

Example

Query
mutation deleteInsightsDashboard($id: ID!) {
  deleteInsightsDashboard(id: $id) {
    alwaysNil
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "deleteInsightsDashboard": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteNotebook

Description

Delete a notebook. Only the owner can delete it.

Response

Returns an EmptyResponse!

Arguments
Name Description
id - ID!

Example

Query
mutation deleteNotebook($id: ID!) {
  deleteNotebook(id: $id) {
    alwaysNil
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "deleteNotebook": {
      "alwaysNil": "abc123"
    }
  }
}

deleteNotebookStar

Description

Delete the notebook star for the current user, if exists.

Response

Returns an EmptyResponse!

Arguments
Name Description
notebookID - ID!

Example

Query
mutation deleteNotebookStar($notebookID: ID!) {
  deleteNotebookStar(notebookID: $notebookID) {
    alwaysNil
  }
}
Variables
{"notebookID": 4}
Response
{
  "data": {
    "deleteNotebookStar": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteOrganization

Description

Soft deletes an organization.

Only site admins may perform this mutation.

Response

Returns an EmptyResponse

Arguments
Name Description
organization - ID!

Example

Query
mutation deleteOrganization($organization: ID!) {
  deleteOrganization(organization: $organization) {
    alwaysNil
  }
}
Variables
{"organization": "4"}
Response
{
  "data": {
    "deleteOrganization": {
      "alwaysNil": "abc123"
    }
  }
}

deleteOutboundWebhook

Description

Deletes an outbound webhook.

Only site admins have access to this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
id - ID!

Example

Query
mutation deleteOutboundWebhook($id: ID!) {
  deleteOutboundWebhook(id: $id) {
    alwaysNil
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "deleteOutboundWebhook": {
      "alwaysNil": "xyz789"
    }
  }
}

deletePackageRepoFilter

Description

Deletes a package repo reference filter.

Response

Returns an EmptyResponse!

Arguments
Name Description
id - ID!

Example

Query
mutation deletePackageRepoFilter($id: ID!) {
  deletePackageRepoFilter(id: $id) {
    alwaysNil
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "deletePackageRepoFilter": {
      "alwaysNil": "xyz789"
    }
  }
}

deletePreciseIndex

Description

Deletes a precise index.

Response

Returns an EmptyResponse

Arguments
Name Description
id - ID!

Example

Query
mutation deletePreciseIndex($id: ID!) {
  deletePreciseIndex(id: $id) {
    alwaysNil
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "deletePreciseIndex": {
      "alwaysNil": "xyz789"
    }
  }
}

deletePreciseIndexes

Description

Deletes precise indexes by filter criteria.

Response

Returns an EmptyResponse

Arguments
Name Description
query - String An (optional) search query that filters the state, repository name, commit, root, and indexer properties.
states - [PreciseIndexState!] The index state.
indexerKey - String If supplied, only precise indexes created by an indexer with the given key are modified.
isLatestForRepo - Boolean When specified, only deletes indexes that are latest for the given repository.
repository - ID The repository.

Example

Query
mutation deletePreciseIndexes(
  $query: String,
  $states: [PreciseIndexState!],
  $indexerKey: String,
  $isLatestForRepo: Boolean,
  $repository: ID
) {
  deletePreciseIndexes(
    query: $query,
    states: $states,
    indexerKey: $indexerKey,
    isLatestForRepo: $isLatestForRepo,
    repository: $repository
  ) {
    alwaysNil
  }
}
Variables
{
  "query": "abc123",
  "states": ["UPLOADING_INDEX"],
  "indexerKey": "abc123",
  "isLatestForRepo": false,
  "repository": 4
}
Response
{
  "data": {
    "deletePreciseIndexes": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteRankingProgress

Description

Deletes the ranking progress object associated with a particular graph key.

Response

Returns an EmptyResponse

Arguments
Name Description
graphKey - String!

Example

Query
mutation deleteRankingProgress($graphKey: String!) {
  deleteRankingProgress(graphKey: $graphKey) {
    alwaysNil
  }
}
Variables
{"graphKey": "xyz789"}
Response
{
  "data": {
    "deleteRankingProgress": {
      "alwaysNil": "abc123"
    }
  }
}

deleteRepoKeyValuePair

Use deleteRepoMetadata instead. This field is a deprecated and will be removed in a future release.
Description

Delete a key-value pair associated with a repo.

Response

Returns an EmptyResponse!

Arguments
Name Description
repo - ID!
key - String!

Example

Query
mutation deleteRepoKeyValuePair(
  $repo: ID!,
  $key: String!
) {
  deleteRepoKeyValuePair(
    repo: $repo,
    key: $key
  ) {
    alwaysNil
  }
}
Variables
{"repo": 4, "key": "xyz789"}
Response
{
  "data": {
    "deleteRepoKeyValuePair": {
      "alwaysNil": "abc123"
    }
  }
}

deleteRepoMetadata

Description

Delete a key-value pair metadata associated with a repo.

Response

Returns an EmptyResponse!

Arguments
Name Description
repo - ID!
key - String!

Example

Query
mutation deleteRepoMetadata(
  $repo: ID!,
  $key: String!
) {
  deleteRepoMetadata(
    repo: $repo,
    key: $key
  ) {
    alwaysNil
  }
}
Variables
{
  "repo": "4",
  "key": "abc123"
}
Response
{
  "data": {
    "deleteRepoMetadata": {
      "alwaysNil": "abc123"
    }
  }
}

deleteRepositoryFromDisk

Description

INTERNAL ONLY: Delete a repository from the gitserver. This involves deleting the file on disk, and marking it as not-cloned in the database.

Response

Returns an EmptyResponse!

Arguments
Name Description
repo - ID!

Example

Query
mutation deleteRepositoryFromDisk($repo: ID!) {
  deleteRepositoryFromDisk(repo: $repo) {
    alwaysNil
  }
}
Variables
{"repo": 4}
Response
{
  "data": {
    "deleteRepositoryFromDisk": {
      "alwaysNil": "abc123"
    }
  }
}

deleteRole

Description

Deletes a role. This mutation targets only non-system roles. Any users who were assigned to the role will be unassigned and lose any permissions associated with it.

Response

Returns an EmptyResponse!

Arguments
Name Description
role - ID!

Example

Query
mutation deleteRole($role: ID!) {
  deleteRole(role: $role) {
    alwaysNil
  }
}
Variables
{"role": "4"}
Response
{
  "data": {
    "deleteRole": {"alwaysNil": "xyz789"}
  }
}

deleteSavedSearch

Description

Deletes a saved search

Response

Returns an EmptyResponse

Arguments
Name Description
id - ID!

Example

Query
mutation deleteSavedSearch($id: ID!) {
  deleteSavedSearch(id: $id) {
    alwaysNil
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "deleteSavedSearch": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteSearchContext

Description

Delete search context.

Response

Returns an EmptyResponse!

Arguments
Name Description
id - ID!

Example

Query
mutation deleteSearchContext($id: ID!) {
  deleteSearchContext(id: $id) {
    alwaysNil
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "deleteSearchContext": {
      "alwaysNil": "xyz789"
    }
  }
}

deleteSearchContextStar

Description

Delete a star on a search context for the specified user. If the star does not exist, this is a no-op.

Response

Returns an EmptyResponse!

Arguments
Name Description
searchContextID - ID!
userID - ID!

Example

Query
mutation deleteSearchContextStar(
  $searchContextID: ID!,
  $userID: ID!
) {
  deleteSearchContextStar(
    searchContextID: $searchContextID,
    userID: $userID
  ) {
    alwaysNil
  }
}
Variables
{"searchContextID": 4, "userID": 4}
Response
{
  "data": {
    "deleteSearchContextStar": {
      "alwaysNil": "abc123"
    }
  }
}

deleteSearchJob

Description

EXPERIMENTAL: Delete a search job. This will delete all of the search's repositories and revisions.

Response

Returns an EmptyResponse!

Arguments
Name Description
id - ID! The ID of the search job to delete.

Example

Query
mutation deleteSearchJob($id: ID!) {
  deleteSearchJob(id: $id) {
    alwaysNil
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "deleteSearchJob": {
      "alwaysNil": "abc123"
    }
  }
}

deleteTeam

Description

Delete team deletes a team. ID or Name must be specified, but not both. Must be team-member to delete. If the team is marked as read-only, must be site-admin.

Response

Returns an EmptyResponse

Arguments
Name Description
id - ID
name - String

Example

Query
mutation deleteTeam(
  $id: ID,
  $name: String
) {
  deleteTeam(
    id: $id,
    name: $name
  ) {
    alwaysNil
  }
}
Variables
{"id": 4, "name": "xyz789"}
Response
{
  "data": {
    "deleteTeam": {"alwaysNil": "abc123"}
  }
}

deleteUser

Description

Deletes a user account. Only site admins may perform this mutation.

If hard == true, a hard delete is performed. By default, deletes are 'soft deletes' and could theoretically be undone with manual DB commands. If a hard delete is performed, the data is truly removed from the database and deletion can NEVER be undone.

Data that is deleted as part of this operation:

  • All user data (access tokens, email addresses, external account info, survey responses, etc)
  • Organization membership information (which organizations the user is a part of, any invitations created by or targeting the user).
  • User, Organization, or Global settings authored by the user.
Response

Returns an EmptyResponse

Arguments
Name Description
user - ID!
hard - Boolean

Example

Query
mutation deleteUser(
  $user: ID!,
  $hard: Boolean
) {
  deleteUser(
    user: $user,
    hard: $hard
  ) {
    alwaysNil
  }
}
Variables
{"user": "4", "hard": false}
Response
{
  "data": {
    "deleteUser": {"alwaysNil": "abc123"}
  }
}

deleteUsers

Description

Bulk "deleteUser" action.

Response

Returns an EmptyResponse

Arguments
Name Description
users - [ID!]!
hard - Boolean

Example

Query
mutation deleteUsers(
  $users: [ID!]!,
  $hard: Boolean
) {
  deleteUsers(
    users: $users,
    hard: $hard
  ) {
    alwaysNil
  }
}
Variables
{"users": ["4"], "hard": false}
Response
{
  "data": {
    "deleteUsers": {"alwaysNil": "xyz789"}
  }
}

deleteWebhook

Description

Deletes a webhook by given ID. Only site admins may perform this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
id - ID!

Example

Query
mutation deleteWebhook($id: ID!) {
  deleteWebhook(id: $id) {
    alwaysNil
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "deleteWebhook": {"alwaysNil": "abc123"}
  }
}

detachChangesets

Description

Detach archived changesets from a batch change.

Experimental: This API is likely to change in the future.

Response

Returns a BulkOperation!

Arguments
Name Description
batchChange - ID!
changesets - [ID!]!

Example

Query
mutation detachChangesets(
  $batchChange: ID!,
  $changesets: [ID!]!
) {
  detachChangesets(
    batchChange: $batchChange,
    changesets: $changesets
  ) {
    id
    type
    state
    progress
    errors {
      ...ChangesetJobErrorFragment
    }
    createdAt
    finishedAt
    initiator {
      ...UserFragment
    }
    changesetCount
  }
}
Variables
{"batchChange": "4", "changesets": [4]}
Response
{
  "data": {
    "detachChangesets": {
      "id": 4,
      "type": "COMMENT",
      "state": "PROCESSING",
      "progress": 123.45,
      "errors": [ChangesetJobError],
      "createdAt": "2007-12-03T10:15:30Z",
      "finishedAt": "2007-12-03T10:15:30Z",
      "initiator": User,
      "changesetCount": 987
    }
  }
}

dotcom

Description

Mutations that are only used on Sourcegraph.com.

FOR INTERNAL USE ONLY.

Response

Returns a DotcomMutation!

Example

Query
mutation dotcom {
  dotcom {
    createProductSubscription {
      ...ProductSubscriptionFragment
    }
    generateProductLicenseForSubscription {
      ...ProductLicenseFragment
    }
    revokeLicense {
      ...EmptyResponseFragment
    }
    updateProductSubscription {
      ...EmptyResponseFragment
    }
    archiveProductSubscription {
      ...EmptyResponseFragment
    }
  }
}
Response
{
  "data": {
    "dotcom": {
      "createProductSubscription": ProductSubscription,
      "generateProductLicenseForSubscription": ProductLicense,
      "revokeLicense": EmptyResponse,
      "updateProductSubscription": EmptyResponse,
      "archiveProductSubscription": EmptyResponse
    }
  }
}

editTemporarySettings

Description

Merges the given settings edit with the current temporary settings for the current user. Keys in the given edit take priority over key in the temporary settings. The merge is not recursive. If temporary settings for the user do not exist, they are created.

Response

Returns an EmptyResponse!

Arguments
Name Description
settingsToEdit - String! The settings to merge with the current temporary settings for the current user, as a JSON string.

Example

Query
mutation editTemporarySettings($settingsToEdit: String!) {
  editTemporarySettings(settingsToEdit: $settingsToEdit) {
    alwaysNil
  }
}
Variables
{"settingsToEdit": "xyz789"}
Response
{
  "data": {
    "editTemporarySettings": {
      "alwaysNil": "xyz789"
    }
  }
}

enqueueBatchSpecWorkspaceExecution

Description

Enqueue the workspace for execution. The workspace must not be running, and not be in a final state. This can be used for running single workspaces before running the full set.

Response

Returns an EmptyResponse!

Arguments
Name Description
batchSpecWorkspaces - [ID!]!

Example

Query
mutation enqueueBatchSpecWorkspaceExecution($batchSpecWorkspaces: [ID!]!) {
  enqueueBatchSpecWorkspaceExecution(batchSpecWorkspaces: $batchSpecWorkspaces) {
    alwaysNil
  }
}
Variables
{"batchSpecWorkspaces": ["4"]}
Response
{
  "data": {
    "enqueueBatchSpecWorkspaceExecution": {
      "alwaysNil": "xyz789"
    }
  }
}

excludeRepoFromExternalServices

Description

Excludes a repo from external services configs. Only site admins may perform this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
externalServices - [ID!]!
repo - ID!

Example

Query
mutation excludeRepoFromExternalServices(
  $externalServices: [ID!]!,
  $repo: ID!
) {
  excludeRepoFromExternalServices(
    externalServices: $externalServices,
    repo: $repo
  ) {
    alwaysNil
  }
}
Variables
{"externalServices": ["4"], "repo": 4}
Response
{
  "data": {
    "excludeRepoFromExternalServices": {
      "alwaysNil": "abc123"
    }
  }
}

executeBatchSpec

Description

Enqueue the workspaces that resulted from evaluation in createBatchSpecFromRawto be executed. These will eventually be moved into running state. resolution is done, to support fast edits. Once the workspace resolution is done, workspace jobs are move to state QUEUED. If resolving is already done by the time this mutation is called, they are enqueued immediately.

Must be invoked by the same user that called createBatchSpecFromRaw before. Can only be invoked once. If workspace resolution fails, the running flag should be reset to false. API consumers can find this state by looking at BatchSpecWorkspaceResolution.failureMessage.

TODO: This might be blocking with an error for now.

Response

Returns a BatchSpec!

Arguments
Name Description
batchSpec - ID! The ID of the batch spec.
noCache - Boolean Don't use cache entries. If set, will overwrite the current batchSpec.NoCache state.
autoApply - Boolean

Right away set the autoApplyEnabled flag on the batch spec.

TODO: Not implemented yet. Default = false

Example

Query
mutation executeBatchSpec(
  $batchSpec: ID!,
  $noCache: Boolean,
  $autoApply: Boolean
) {
  executeBatchSpec(
    batchSpec: $batchSpec,
    noCache: $noCache,
    autoApply: $autoApply
  ) {
    id
    autoApplyEnabled
    state
    originalInput
    parsedInput
    description {
      ...BatchChangeDescriptionFragment
    }
    applyPreview {
      ...ChangesetApplyPreviewConnectionFragment
    }
    changesetSpecs {
      ...ChangesetSpecConnectionFragment
    }
    creator {
      ...UserFragment
    }
    createdAt
    startedAt
    finishedAt
    namespace {
      ...NamespaceFragment
    }
    expiresAt
    applyURL
    viewerCanAdminister
    diffStat {
      ...DiffStatFragment
    }
    appliesToBatchChange {
      ...BatchChangeFragment
    }
    supersedingBatchSpec {
      ...BatchSpecFragment
    }
    viewerBatchChangesCodeHosts {
      ...BatchChangesCodeHostConnectionFragment
    }
    workspaceResolution {
      ...BatchSpecWorkspaceResolutionFragment
    }
    importingChangesets {
      ...ChangesetSpecConnectionFragment
    }
    failureMessage
    allowIgnored
    allowUnsupported
    noCache
    viewerCanRetry
    source
    files {
      ...BatchSpecWorkspaceFileConnectionFragment
    }
  }
}
Variables
{
  "batchSpec": "4",
  "noCache": false,
  "autoApply": false
}
Response
{
  "data": {
    "executeBatchSpec": {
      "id": "4",
      "autoApplyEnabled": true,
      "state": "PENDING",
      "originalInput": "abc123",
      "parsedInput": JSONValue,
      "description": BatchChangeDescription,
      "applyPreview": ChangesetApplyPreviewConnection,
      "changesetSpecs": ChangesetSpecConnection,
      "creator": User,
      "createdAt": "2007-12-03T10:15:30Z",
      "startedAt": "2007-12-03T10:15:30Z",
      "finishedAt": "2007-12-03T10:15:30Z",
      "namespace": Namespace,
      "expiresAt": "2007-12-03T10:15:30Z",
      "applyURL": "abc123",
      "viewerCanAdminister": true,
      "diffStat": DiffStat,
      "appliesToBatchChange": BatchChange,
      "supersedingBatchSpec": BatchSpec,
      "viewerBatchChangesCodeHosts": BatchChangesCodeHostConnection,
      "workspaceResolution": BatchSpecWorkspaceResolution,
      "importingChangesets": ChangesetSpecConnection,
      "failureMessage": "xyz789",
      "allowIgnored": true,
      "allowUnsupported": false,
      "noCache": false,
      "viewerCanRetry": true,
      "source": "LOCAL",
      "files": BatchSpecWorkspaceFileConnection
    }
  }
}

invalidateSessionsByID

Description

Invalidates all sessions belonging to a user.

Only site admins may perform this mutation.

Response

Returns an EmptyResponse

Arguments
Name Description
userID - ID!

Example

Query
mutation invalidateSessionsByID($userID: ID!) {
  invalidateSessionsByID(userID: $userID) {
    alwaysNil
  }
}
Variables
{"userID": 4}
Response
{
  "data": {
    "invalidateSessionsByID": {
      "alwaysNil": "abc123"
    }
  }
}

invalidateSessionsByIDs

Description

Bulk "invalidateSessionsByID" action.

Response

Returns an EmptyResponse

Arguments
Name Description
userIDs - [ID!]!

Example

Query
mutation invalidateSessionsByIDs($userIDs: [ID!]!) {
  invalidateSessionsByIDs(userIDs: $userIDs) {
    alwaysNil
  }
}
Variables
{"userIDs": ["4"]}
Response
{
  "data": {
    "invalidateSessionsByIDs": {
      "alwaysNil": "xyz789"
    }
  }
}

inviteUserToOrganization

Description

Invite the user with the given username to join the organization. The invited user account must already exist.

Only site admins and any organization member may perform this mutation.

Response

Returns an InviteUserToOrganizationResult!

Arguments
Name Description
organization - ID!
username - String!

Example

Query
mutation inviteUserToOrganization(
  $organization: ID!,
  $username: String!
) {
  inviteUserToOrganization(
    organization: $organization,
    username: $username
  ) {
    sentInvitationEmail
    invitationURL
  }
}
Variables
{"organization": 4, "username": "abc123"}
Response
{
  "data": {
    "inviteUserToOrganization": {
      "sentInvitationEmail": false,
      "invitationURL": "xyz789"
    }
  }
}

logEvent

use telemetry { recordEvent } instead
Description

Logs an event.

Response

Returns an EmptyResponse

Arguments
Name Description
event - String! The name of the event.
userCookieID - String! The randomly generated unique user ID stored in a browser cookie.
firstSourceURL - String The first sourcegraph URL visited by the user, stored in a browser cookie.
lastSourceURL - String The last sourcegraph URL visited by the user, stored in a browser cookie.
url - String! The URL when the event was logged.
source - EventSource! The source of the event.
cohortID - String An optional cohort ID to identify the user as part of a specific A/B test. The cohort ID is expected to be a date in the form YYYY-MM-DD
referrer - String An optional referrer parameter for the user's current session. Only captured and stored on Sourcegraph Cloud.
originalReferrer - String The original referrer for a user
sessionReferrer - String The session referrer for a user
sessionFirstURL - String The sessions first url for a user
deviceSessionID - String Device session ID to identify the user's session for analytics.
argument - String The additional argument information.
publicArgument - String Public argument information. PRIVACY: Do NOT include any potentially private information in this field. These properties get sent to our analytics tools for Cloud, so must not include private information, such as search queries or repository names.
deviceID - String Device ID used for Amplitude analytics. Used on Sourcegraph Cloud only.
eventID - Int Event ID used to deduplicate events that occur simultaneously in Amplitude analytics. See https://developers.amplitude.com/docs/http-api-v2#optional-keys. Used on Sourcegraph Cloud only.
insertID - String Insert ID used to deduplicate events that re-occur in the event of retries or backfills in Amplitude analytics. See https://developers.amplitude.com/docs/http-api-v2#optional-keys. Used on Sourcegraph Cloud only.
client - String The client that this event is being sent from.
billingProductCategory - String The product category for the event, used for billing purposes.
billingEventID - String The billing ID for the event, used for tagging user events for billing aggregation purposes.
connectedSiteID - String The site ID that the client was connected to when the event was logged.
hashedLicenseKey - String The connected site's license key, hashed using sha256. Used for uniquely identifying the site.

Example

Query
mutation logEvent(
  $event: String!,
  $userCookieID: String!,
  $firstSourceURL: String,
  $lastSourceURL: String,
  $url: String!,
  $source: EventSource!,
  $cohortID: String,
  $referrer: String,
  $originalReferrer: String,
  $sessionReferrer: String,
  $sessionFirstURL: String,
  $deviceSessionID: String,
  $argument: String,
  $publicArgument: String,
  $deviceID: String,
  $eventID: Int,
  $insertID: String,
  $client: String,
  $billingProductCategory: String,
  $billingEventID: String,
  $connectedSiteID: String,
  $hashedLicenseKey: String
) {
  logEvent(
    event: $event,
    userCookieID: $userCookieID,
    firstSourceURL: $firstSourceURL,
    lastSourceURL: $lastSourceURL,
    url: $url,
    source: $source,
    cohortID: $cohortID,
    referrer: $referrer,
    originalReferrer: $originalReferrer,
    sessionReferrer: $sessionReferrer,
    sessionFirstURL: $sessionFirstURL,
    deviceSessionID: $deviceSessionID,
    argument: $argument,
    publicArgument: $publicArgument,
    deviceID: $deviceID,
    eventID: $eventID,
    insertID: $insertID,
    client: $client,
    billingProductCategory: $billingProductCategory,
    billingEventID: $billingEventID,
    connectedSiteID: $connectedSiteID,
    hashedLicenseKey: $hashedLicenseKey
  ) {
    alwaysNil
  }
}
Variables
{
  "event": "abc123",
  "userCookieID": "xyz789",
  "firstSourceURL": "xyz789",
  "lastSourceURL": "abc123",
  "url": "xyz789",
  "source": "WEB",
  "cohortID": "abc123",
  "referrer": "abc123",
  "originalReferrer": "abc123",
  "sessionReferrer": "xyz789",
  "sessionFirstURL": "abc123",
  "deviceSessionID": "abc123",
  "argument": "xyz789",
  "publicArgument": "xyz789",
  "deviceID": "abc123",
  "eventID": 123,
  "insertID": "abc123",
  "client": "xyz789",
  "billingProductCategory": "abc123",
  "billingEventID": "xyz789",
  "connectedSiteID": "abc123",
  "hashedLicenseKey": "abc123"
}
Response
{
  "data": {
    "logEvent": {"alwaysNil": "xyz789"}
  }
}

logEvents

use telemetry { recordEvent } instead
Description

Logs a batch of events.

Response

Returns an EmptyResponse

Arguments
Name Description
events - [Event!]

Example

Query
mutation logEvents($events: [Event!]) {
  logEvents(events: $events) {
    alwaysNil
  }
}
Variables
{"events": [Event]}
Response
{
  "data": {
    "logEvents": {"alwaysNil": "xyz789"}
  }
}

logUserEvent

use telemetry { recordEvent } instead
Description

Logs a user event. No longer used, only here for backwards compatibility with IDE and browser extensions.

Response

Returns an EmptyResponse

Arguments
Name Description
event - UserEvent!
userCookieID - String!

Example

Query
mutation logUserEvent(
  $event: UserEvent!,
  $userCookieID: String!
) {
  logUserEvent(
    event: $event,
    userCookieID: $userCookieID
  ) {
    alwaysNil
  }
}
Variables
{
  "event": "PAGEVIEW",
  "userCookieID": "xyz789"
}
Response
{
  "data": {
    "logUserEvent": {"alwaysNil": "abc123"}
  }
}

mergeChangesets

Description

Merge multiple changesets. If squash is true, the commits will be squashed into a single commit on code hosts that support squash-and-merge.

Experimental: This API is likely to change in the future.

Response

Returns a BulkOperation!

Arguments
Name Description
batchChange - ID!
changesets - [ID!]!
squash - Boolean Default = false

Example

Query
mutation mergeChangesets(
  $batchChange: ID!,
  $changesets: [ID!]!,
  $squash: Boolean
) {
  mergeChangesets(
    batchChange: $batchChange,
    changesets: $changesets,
    squash: $squash
  ) {
    id
    type
    state
    progress
    errors {
      ...ChangesetJobErrorFragment
    }
    createdAt
    finishedAt
    initiator {
      ...UserFragment
    }
    changesetCount
  }
}
Variables
{
  "batchChange": 4,
  "changesets": ["4"],
  "squash": false
}
Response
{
  "data": {
    "mergeChangesets": {
      "id": 4,
      "type": "COMMENT",
      "state": "PROCESSING",
      "progress": 987.65,
      "errors": [ChangesetJobError],
      "createdAt": "2007-12-03T10:15:30Z",
      "finishedAt": "2007-12-03T10:15:30Z",
      "initiator": User,
      "changesetCount": 987
    }
  }
}

migrateToQdrant

Description

TEMPORARY: creates a new embedding job for all completed embeddings jobs so that they will be moved from blobstore to qdrant

Response

Returns an EmptyResponse!

Example

Query
mutation migrateToQdrant {
  migrateToQdrant {
    alwaysNil
  }
}
Response
{
  "data": {
    "migrateToQdrant": {
      "alwaysNil": "abc123"
    }
  }
}

moveBatchChange

Description

Move a batch change to a different namespace, or rename it in the current namespace.

Response

Returns a BatchChange!

Arguments
Name Description
batchChange - ID!
newName - String
newNamespace - ID

Example

Query
mutation moveBatchChange(
  $batchChange: ID!,
  $newName: String,
  $newNamespace: ID
) {
  moveBatchChange(
    batchChange: $batchChange,
    newName: $newName,
    newNamespace: $newNamespace
  ) {
    id
    namespace {
      ...NamespaceFragment
    }
    name
    description
    state
    creator {
      ...UserFragment
    }
    lastApplier {
      ...UserFragment
    }
    viewerCanAdminister
    url
    createdAt
    updatedAt
    lastAppliedAt
    closedAt
    changesetsStats {
      ...ChangesetsStatsFragment
    }
    changesets {
      ...ChangesetConnectionFragment
    }
    changesetCountsOverTime {
      ...ChangesetCountsFragment
    }
    diffStat {
      ...DiffStatFragment
    }
    currentSpec {
      ...BatchSpecFragment
    }
    bulkOperations {
      ...BulkOperationConnectionFragment
    }
    batchSpecs {
      ...BatchSpecConnectionFragment
    }
  }
}
Variables
{
  "batchChange": "4",
  "newName": "abc123",
  "newNamespace": 4
}
Response
{
  "data": {
    "moveBatchChange": {
      "id": "4",
      "namespace": Namespace,
      "name": "xyz789",
      "description": "abc123",
      "state": "OPEN",
      "creator": User,
      "lastApplier": User,
      "viewerCanAdminister": true,
      "url": "abc123",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "lastAppliedAt": "2007-12-03T10:15:30Z",
      "closedAt": "2007-12-03T10:15:30Z",
      "changesetsStats": ChangesetsStats,
      "changesets": ChangesetConnection,
      "changesetCountsOverTime": [ChangesetCounts],
      "diffStat": DiffStat,
      "currentSpec": BatchSpec,
      "bulkOperations": BulkOperationConnection,
      "batchSpecs": BatchSpecConnection
    }
  }
}

moveInsightSeriesBackfillToBackOfQueue

Description

Updates the priority of an insight series backfill making it the lowest priority given the graphql ID of the InsightBackfillQueueItem

Response

Returns an InsightBackfillQueueItem!

Arguments
Name Description
id - ID!

Example

Query
mutation moveInsightSeriesBackfillToBackOfQueue($id: ID!) {
  moveInsightSeriesBackfillToBackOfQueue(id: $id) {
    id
    insightViewTitle
    creator {
      ...UserFragment
    }
    seriesLabel
    seriesSearchQuery
    backfillQueueStatus {
      ...BackfillStatusFragment
    }
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "moveInsightSeriesBackfillToBackOfQueue": {
      "id": 4,
      "insightViewTitle": "xyz789",
      "creator": User,
      "seriesLabel": "xyz789",
      "seriesSearchQuery": "xyz789",
      "backfillQueueStatus": BackfillStatus
    }
  }
}

moveInsightSeriesBackfillToFrontOfQueue

Description

Updates the priority of an insight series backfill making it the highest priority given the graphql ID of the InsightBackfillQueueItem.

Response

Returns an InsightBackfillQueueItem!

Arguments
Name Description
id - ID!

Example

Query
mutation moveInsightSeriesBackfillToFrontOfQueue($id: ID!) {
  moveInsightSeriesBackfillToFrontOfQueue(id: $id) {
    id
    insightViewTitle
    creator {
      ...UserFragment
    }
    seriesLabel
    seriesSearchQuery
    backfillQueueStatus {
      ...BackfillStatusFragment
    }
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "moveInsightSeriesBackfillToFrontOfQueue": {
      "id": "4",
      "insightViewTitle": "xyz789",
      "creator": User,
      "seriesLabel": "xyz789",
      "seriesSearchQuery": "abc123",
      "backfillQueueStatus": BackfillStatus
    }
  }
}

overwriteTemporarySettings

Description

Overwrites and saves the temporary settings for the current user. If temporary settings for the user do not exist, they are created.

Response

Returns an EmptyResponse!

Arguments
Name Description
contents - String! The new temporary settings for the current user, as a JSON string.

Example

Query
mutation overwriteTemporarySettings($contents: String!) {
  overwriteTemporarySettings(contents: $contents) {
    alwaysNil
  }
}
Variables
{"contents": "xyz789"}
Response
{
  "data": {
    "overwriteTemporarySettings": {
      "alwaysNil": "abc123"
    }
  }
}

publishChangesets

Description

Set the UI publication state for multiple changesets. If draft is true, the changesets are published as drafts, provided the code host supports it.

Experimental: This API is likely to change in the future.

Response

Returns a BulkOperation!

Arguments
Name Description
batchChange - ID!
changesets - [ID!]!
draft - Boolean Default = false

Example

Query
mutation publishChangesets(
  $batchChange: ID!,
  $changesets: [ID!]!,
  $draft: Boolean
) {
  publishChangesets(
    batchChange: $batchChange,
    changesets: $changesets,
    draft: $draft
  ) {
    id
    type
    state
    progress
    errors {
      ...ChangesetJobErrorFragment
    }
    createdAt
    finishedAt
    initiator {
      ...UserFragment
    }
    changesetCount
  }
}
Variables
{
  "batchChange": "4",
  "changesets": ["4"],
  "draft": false
}
Response
{
  "data": {
    "publishChangesets": {
      "id": "4",
      "type": "COMMENT",
      "state": "PROCESSING",
      "progress": 987.65,
      "errors": [ChangesetJobError],
      "createdAt": "2007-12-03T10:15:30Z",
      "finishedAt": "2007-12-03T10:15:30Z",
      "initiator": User,
      "changesetCount": 123
    }
  }
}

queueAutoIndexJobsForRepo

Description

Queues the index jobs for a repository for execution. An optional resolvable revhash (commit, branch name, or tag name) can be specified; by default the tip of the default branch will be used.

If a configuration is supplied, that configuration is used to determine what jobs to schedule. If no configuration is supplied, it will go through the regular index scheduling rules: first read any in-repo configuration (e.g., sourcegraph.yaml), then look for any existing in-database configuration, finally falling back to the automatically inferred configuration based on the repo contents at the target commit.

Response

Returns [PreciseIndex!]!

Arguments
Name Description
repository - ID!
rev - String
configuration - String

Example

Query
mutation queueAutoIndexJobsForRepo(
  $repository: ID!,
  $rev: String,
  $configuration: String
) {
  queueAutoIndexJobsForRepo(
    repository: $repository,
    rev: $rev,
    configuration: $configuration
  ) {
    id
    projectRoot {
      ...CodeIntelGitTreeFragment
    }
    inputCommit
    inputRoot
    inputIndexer
    tags
    indexer {
      ...CodeIntelIndexerFragment
    }
    state
    queuedAt
    indexingStartedAt
    indexingFinishedAt
    uploadedAt
    processingStartedAt
    processingFinishedAt
    failure
    placeInQueue
    steps {
      ...IndexStepsFragment
    }
    shouldReindex
    isLatestForRepo
    retentionPolicyOverview {
      ...CodeIntelligenceRetentionPolicyMatchesConnectionFragment
    }
    auditLogs {
      ...LSIFUploadAuditLogFragment
    }
  }
}
Variables
{
  "repository": "4",
  "rev": "xyz789",
  "configuration": "xyz789"
}
Response
{
  "data": {
    "queueAutoIndexJobsForRepo": [
      {
        "id": 4,
        "projectRoot": CodeIntelGitTree,
        "inputCommit": "abc123",
        "inputRoot": "abc123",
        "inputIndexer": "xyz789",
        "tags": ["abc123"],
        "indexer": CodeIntelIndexer,
        "state": "UPLOADING_INDEX",
        "queuedAt": "2007-12-03T10:15:30Z",
        "indexingStartedAt": "2007-12-03T10:15:30Z",
        "indexingFinishedAt": "2007-12-03T10:15:30Z",
        "uploadedAt": "2007-12-03T10:15:30Z",
        "processingStartedAt": "2007-12-03T10:15:30Z",
        "processingFinishedAt": "2007-12-03T10:15:30Z",
        "failure": "xyz789",
        "placeInQueue": 123,
        "steps": IndexSteps,
        "shouldReindex": true,
        "isLatestForRepo": false,
        "retentionPolicyOverview": CodeIntelligenceRetentionPolicyMatchesConnection,
        "auditLogs": [LSIFUploadAuditLog]
      }
    ]
  }
}

randomizeUserPassword

Description

Randomize a user's password so that they need to reset it before they can sign in again.

Only site admins may perform this mutation.

Response

Returns a RandomizeUserPasswordResult!

Arguments
Name Description
user - ID!

Example

Query
mutation randomizeUserPassword($user: ID!) {
  randomizeUserPassword(user: $user) {
    resetPasswordURL
    emailSent
  }
}
Variables
{"user": "4"}
Response
{
  "data": {
    "randomizeUserPassword": {
      "resetPasswordURL": "abc123",
      "emailSent": false
    }
  }
}

recloneRepository

Description

INTERNAL ONLY: Reclone a repository from the gitserver. This involves deleting the file on disk, marking it as not-cloned in the database, and then initiating a repo clone.

Response

Returns an EmptyResponse!

Arguments
Name Description
repo - ID!

Example

Query
mutation recloneRepository($repo: ID!) {
  recloneRepository(repo: $repo) {
    alwaysNil
  }
}
Variables
{"repo": 4}
Response
{
  "data": {
    "recloneRepository": {
      "alwaysNil": "abc123"
    }
  }
}

recoverUsers

Description

Bulk "recoverUser" action.

Response

Returns an EmptyResponse

Arguments
Name Description
userIDs - [ID!]!

Example

Query
mutation recoverUsers($userIDs: [ID!]!) {
  recoverUsers(userIDs: $userIDs) {
    alwaysNil
  }
}
Variables
{"userIDs": [4]}
Response
{
  "data": {
    "recoverUsers": {"alwaysNil": "abc123"}
  }
}

reenqueueChangeset

Description

Re-enqueue the changeset for processing by the reconciler. The changeset must be in FAILED state.

Response

Returns a Changeset!

Arguments
Name Description
changeset - ID!

Example

Query
mutation reenqueueChangeset($changeset: ID!) {
  reenqueueChangeset(changeset: $changeset) {
    id
    batchChanges {
      ...BatchChangeConnectionFragment
    }
    state
    createdAt
    updatedAt
    nextSyncAt
  }
}
Variables
{"changeset": 4}
Response
{
  "data": {
    "reenqueueChangeset": {
      "id": 4,
      "batchChanges": BatchChangeConnection,
      "state": "UNPUBLISHED",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "nextSyncAt": "2007-12-03T10:15:30Z"
    }
  }
}

reenqueueChangesets

Description

Reenqueue multiple changesets for processing.

Experimental: This API is likely to change in the future.

Response

Returns a BulkOperation!

Arguments
Name Description
batchChange - ID!
changesets - [ID!]!

Example

Query
mutation reenqueueChangesets(
  $batchChange: ID!,
  $changesets: [ID!]!
) {
  reenqueueChangesets(
    batchChange: $batchChange,
    changesets: $changesets
  ) {
    id
    type
    state
    progress
    errors {
      ...ChangesetJobErrorFragment
    }
    createdAt
    finishedAt
    initiator {
      ...UserFragment
    }
    changesetCount
  }
}
Variables
{"batchChange": "4", "changesets": [4]}
Response
{
  "data": {
    "reenqueueChangesets": {
      "id": "4",
      "type": "COMMENT",
      "state": "PROCESSING",
      "progress": 123.45,
      "errors": [ChangesetJobError],
      "createdAt": "2007-12-03T10:15:30Z",
      "finishedAt": "2007-12-03T10:15:30Z",
      "initiator": User,
      "changesetCount": 987
    }
  }
}

reindexPreciseIndex

Description

Marks a precise index as replaceable by auto-indexing.

Response

Returns an EmptyResponse

Arguments
Name Description
id - ID!

Example

Query
mutation reindexPreciseIndex($id: ID!) {
  reindexPreciseIndex(id: $id) {
    alwaysNil
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "reindexPreciseIndex": {
      "alwaysNil": "xyz789"
    }
  }
}

reindexPreciseIndexes

Description

Marks precise indexes by filter criteria as replaceable by auto-indexing.

Response

Returns an EmptyResponse

Arguments
Name Description
query - String An (optional) search query that filters the state, repository name, commit, root, and indexer properties.
states - [PreciseIndexState!] The index state.
indexerKey - String If supplied, only precise indexes created by an indexer with the given key are modified.
isLatestForRepo - Boolean When specified, only modifies indexes that are latest for the given repository.
repository - ID The repository.

Example

Query
mutation reindexPreciseIndexes(
  $query: String,
  $states: [PreciseIndexState!],
  $indexerKey: String,
  $isLatestForRepo: Boolean,
  $repository: ID
) {
  reindexPreciseIndexes(
    query: $query,
    states: $states,
    indexerKey: $indexerKey,
    isLatestForRepo: $isLatestForRepo,
    repository: $repository
  ) {
    alwaysNil
  }
}
Variables
{
  "query": "abc123",
  "states": ["UPLOADING_INDEX"],
  "indexerKey": "xyz789",
  "isLatestForRepo": false,
  "repository": "4"
}
Response
{
  "data": {
    "reindexPreciseIndexes": {
      "alwaysNil": "abc123"
    }
  }
}

reindexRepository

Description

Force Zoekt to reindex the repository right now. Reindexing occurs automatically, so this should not normally be needed.

Response

Returns an EmptyResponse!

Arguments
Name Description
repository - ID! The repository to index

Example

Query
mutation reindexRepository($repository: ID!) {
  reindexRepository(repository: $repository) {
    alwaysNil
  }
}
Variables
{"repository": 4}
Response
{
  "data": {
    "reindexRepository": {
      "alwaysNil": "xyz789"
    }
  }
}

reloadSite

Description

Reloads the site by restarting the server. This is not supported for all deployment types. This may cause downtime.

Only site admins may perform this mutation.

Response

Returns an EmptyResponse

Example

Query
mutation reloadSite {
  reloadSite {
    alwaysNil
  }
}
Response
{
  "data": {
    "reloadSite": {"alwaysNil": "abc123"}
  }
}

removeAssignedOwner

Description

removeAssignedOwner removes an assigned owner.

Response

Returns an EmptyResponse

Arguments
Name Description
input - AssignOwnerOrTeamInput!

Example

Query
mutation removeAssignedOwner($input: AssignOwnerOrTeamInput!) {
  removeAssignedOwner(input: $input) {
    alwaysNil
  }
}
Variables
{"input": AssignOwnerOrTeamInput}
Response
{
  "data": {
    "removeAssignedOwner": {
      "alwaysNil": "xyz789"
    }
  }
}

removeAssignedTeam

Description

removeAssignedTeam removes an assigned owner.

Response

Returns an EmptyResponse

Arguments
Name Description
input - AssignOwnerOrTeamInput!

Example

Query
mutation removeAssignedTeam($input: AssignOwnerOrTeamInput!) {
  removeAssignedTeam(input: $input) {
    alwaysNil
  }
}
Variables
{"input": AssignOwnerOrTeamInput}
Response
{
  "data": {
    "removeAssignedTeam": {
      "alwaysNil": "abc123"
    }
  }
}

removeInsightViewFromDashboard

Description

Remove an insight view from a dashboard.

Response

Returns an InsightsDashboardPayload!

Arguments
Name Description
input - RemoveInsightViewFromDashboardInput!

Example

Query
mutation removeInsightViewFromDashboard($input: RemoveInsightViewFromDashboardInput!) {
  removeInsightViewFromDashboard(input: $input) {
    dashboard {
      ...InsightsDashboardFragment
    }
  }
}
Variables
{"input": RemoveInsightViewFromDashboardInput}
Response
{
  "data": {
    "removeInsightViewFromDashboard": {
      "dashboard": InsightsDashboard
    }
  }
}

removeTeamMembers

Description

This mutation removes team membership for the given team and set of members. Members that weren't part of the team are ignored.

Either team XOR teamName can be specified to specify the team. Must be team member to remove team members, or site-admin.

For now, members can only be the IDs of User entities in Sourcegraph. Later, we will expand this to allow Persons as well.

If skipUnmatchedMembers is true, members that are not matched to a user are skipped.

Response

Returns a Team!

Arguments
Name Description
team - ID
teamName - String
members - [TeamMemberInput!]!
skipUnmatchedMembers - Boolean Default = false

Example

Query
mutation removeTeamMembers(
  $team: ID,
  $teamName: String,
  $members: [TeamMemberInput!]!,
  $skipUnmatchedMembers: Boolean
) {
  removeTeamMembers(
    team: $team,
    teamName: $teamName,
    members: $members,
    skipUnmatchedMembers: $skipUnmatchedMembers
  ) {
    id
    name
    url
    avatarURL
    displayName
    readonly
    members {
      ...TeamMemberConnectionFragment
    }
    parentTeam {
      ...TeamFragment
    }
    childTeams {
      ...TeamConnectionFragment
    }
    viewerCanAdminister
    creator {
      ...UserFragment
    }
    external
  }
}
Variables
{
  "team": "4",
  "teamName": "xyz789",
  "members": [TeamMemberInput],
  "skipUnmatchedMembers": false
}
Response
{
  "data": {
    "removeTeamMembers": {
      "id": 4,
      "name": "abc123",
      "url": "xyz789",
      "avatarURL": "xyz789",
      "displayName": "abc123",
      "readonly": true,
      "members": TeamMemberConnection,
      "parentTeam": Team,
      "childTeams": TeamConnection,
      "viewerCanAdminister": true,
      "creator": User,
      "external": true
    }
  }
}

removeUserEmail

Description

Removes an email address from the user's account.

Only the user and site admins may perform this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
user - ID!
email - String!

Example

Query
mutation removeUserEmail(
  $user: ID!,
  $email: String!
) {
  removeUserEmail(
    user: $user,
    email: $email
  ) {
    alwaysNil
  }
}
Variables
{
  "user": "4",
  "email": "xyz789"
}
Response
{
  "data": {
    "removeUserEmail": {
      "alwaysNil": "abc123"
    }
  }
}

removeUserFromOrganization

Description

Removes a user as a member from an organization.

Only site admins and any member of the organization may perform this mutation.

Response

Returns an EmptyResponse

Arguments
Name Description
user - ID!
organization - ID!

Example

Query
mutation removeUserFromOrganization(
  $user: ID!,
  $organization: ID!
) {
  removeUserFromOrganization(
    user: $user,
    organization: $organization
  ) {
    alwaysNil
  }
}
Variables
{
  "user": "4",
  "organization": "4"
}
Response
{
  "data": {
    "removeUserFromOrganization": {
      "alwaysNil": "abc123"
    }
  }
}

replaceBatchSpecInput

Description

Replaces the original input of the batch spec. All existing resolution jobs and workspaces are deleted and recreated in the background as the on section is evaluated. This mutation is used for overwriting existing resolutions on unapplied batch specs, so after typing in the editor, we don't create 10s of batch specs. The ID of the batch spec to update should NEVER be that of a batch spec that was already applied to a batch change, or it will be lost.

For creating a new batch spec for a batch change whose previous spec was already applied, use createBatchSpecFromRaw instead.

Response

Returns a BatchSpec!

Arguments
Name Description
previousSpec - ID! The ID of the batch spec resource to update.
batchSpec - String! The raw batch spec as YAML (or the equivalent JSON). See https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/schema/batch_spec.schema.json for the JSON Schema that describes the structure of this input.
allowIgnored - Boolean If true, repos with a .batchignore file will still be included. Default = false
allowUnsupported - Boolean If true, repos on unsupported codehosts will be included. Resulting changesets in these repos cannot be published. Default = false
execute - Boolean

Right away set the execute flag.

TODO: Not implemented yet. Default = false

noCache - Boolean Don't use cache entries. Default = false

Example

Query
mutation replaceBatchSpecInput(
  $previousSpec: ID!,
  $batchSpec: String!,
  $allowIgnored: Boolean,
  $allowUnsupported: Boolean,
  $execute: Boolean,
  $noCache: Boolean
) {
  replaceBatchSpecInput(
    previousSpec: $previousSpec,
    batchSpec: $batchSpec,
    allowIgnored: $allowIgnored,
    allowUnsupported: $allowUnsupported,
    execute: $execute,
    noCache: $noCache
  ) {
    id
    autoApplyEnabled
    state
    originalInput
    parsedInput
    description {
      ...BatchChangeDescriptionFragment
    }
    applyPreview {
      ...ChangesetApplyPreviewConnectionFragment
    }
    changesetSpecs {
      ...ChangesetSpecConnectionFragment
    }
    creator {
      ...UserFragment
    }
    createdAt
    startedAt
    finishedAt
    namespace {
      ...NamespaceFragment
    }
    expiresAt
    applyURL
    viewerCanAdminister
    diffStat {
      ...DiffStatFragment
    }
    appliesToBatchChange {
      ...BatchChangeFragment
    }
    supersedingBatchSpec {
      ...BatchSpecFragment
    }
    viewerBatchChangesCodeHosts {
      ...BatchChangesCodeHostConnectionFragment
    }
    workspaceResolution {
      ...BatchSpecWorkspaceResolutionFragment
    }
    importingChangesets {
      ...ChangesetSpecConnectionFragment
    }
    failureMessage
    allowIgnored
    allowUnsupported
    noCache
    viewerCanRetry
    source
    files {
      ...BatchSpecWorkspaceFileConnectionFragment
    }
  }
}
Variables
{
  "previousSpec": "4",
  "batchSpec": "abc123",
  "allowIgnored": false,
  "allowUnsupported": false,
  "execute": false,
  "noCache": false
}
Response
{
  "data": {
    "replaceBatchSpecInput": {
      "id": 4,
      "autoApplyEnabled": false,
      "state": "PENDING",
      "originalInput": "xyz789",
      "parsedInput": JSONValue,
      "description": BatchChangeDescription,
      "applyPreview": ChangesetApplyPreviewConnection,
      "changesetSpecs": ChangesetSpecConnection,
      "creator": User,
      "createdAt": "2007-12-03T10:15:30Z",
      "startedAt": "2007-12-03T10:15:30Z",
      "finishedAt": "2007-12-03T10:15:30Z",
      "namespace": Namespace,
      "expiresAt": "2007-12-03T10:15:30Z",
      "applyURL": "abc123",
      "viewerCanAdminister": true,
      "diffStat": DiffStat,
      "appliesToBatchChange": BatchChange,
      "supersedingBatchSpec": BatchSpec,
      "viewerBatchChangesCodeHosts": BatchChangesCodeHostConnection,
      "workspaceResolution": BatchSpecWorkspaceResolution,
      "importingChangesets": ChangesetSpecConnection,
      "failureMessage": "abc123",
      "allowIgnored": false,
      "allowUnsupported": false,
      "noCache": false,
      "viewerCanRetry": false,
      "source": "LOCAL",
      "files": BatchSpecWorkspaceFileConnection
    }
  }
}

resendVerificationEmail

Description

Resend a verification email, no op if the email is already verified.

Only the user and site admins may perform this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
user - ID!
email - String!

Example

Query
mutation resendVerificationEmail(
  $user: ID!,
  $email: String!
) {
  resendVerificationEmail(
    user: $user,
    email: $email
  ) {
    alwaysNil
  }
}
Variables
{
  "user": "4",
  "email": "xyz789"
}
Response
{
  "data": {
    "resendVerificationEmail": {
      "alwaysNil": "xyz789"
    }
  }
}

resolvePhabricatorDiff

Description

Resolves a revision for a given diff from Phabricator.

Response

Returns a GitCommit

Arguments
Name Description
repoName - String! The name of the repository that the diff is based on.
diffID - ID! The ID of the diff on Phabricator.
baseRev - String! The base revision this diff is based on.
patch - String The raw contents of the diff from Phabricator. Required if Sourcegraph doesn't have a Conduit API token.
description - String The description of the diff. This will be used as the commit message.
authorName - String The name of author of the diff.
authorEmail - String The author's email.
date - String When the diff was created.

Example

Query
mutation resolvePhabricatorDiff(
  $repoName: String!,
  $diffID: ID!,
  $baseRev: String!,
  $patch: String,
  $description: String,
  $authorName: String,
  $authorEmail: String,
  $date: String
) {
  resolvePhabricatorDiff(
    repoName: $repoName,
    diffID: $diffID,
    baseRev: $baseRev,
    patch: $patch,
    description: $description,
    authorName: $authorName,
    authorEmail: $authorEmail,
    date: $date
  ) {
    id
    repository {
      ...RepositoryFragment
    }
    oid
    abbreviatedOID
    perforceChangelist {
      ...PerforceChangelistFragment
    }
    author {
      ...SignatureFragment
    }
    committer {
      ...SignatureFragment
    }
    message
    subject
    body
    parents {
      ...GitCommitFragment
    }
    url
    canonicalURL
    externalURLs {
      ...ExternalLinkFragment
    }
    path {
      ... on GitTree {
        ...GitTreeFragment
      }
      ... on GitBlob {
        ...GitBlobFragment
      }
    }
    tree {
      ...GitTreeFragment
    }
    fileNames
    blob {
      ...GitBlobFragment
    }
    file {
      ...File2Fragment
    }
    languages
    languageStatistics {
      ...LanguageStatisticsFragment
    }
    ancestors {
      ...GitCommitConnectionFragment
    }
    behindAhead {
      ...BehindAheadCountsFragment
    }
    symbols {
      ...SymbolConnectionFragment
    }
    diff {
      ...RepositoryComparisonFragment
    }
    ownership {
      ...OwnershipConnectionFragment
    }
  }
}
Variables
{
  "repoName": "xyz789",
  "diffID": "4",
  "baseRev": "abc123",
  "patch": "xyz789",
  "description": "abc123",
  "authorName": "abc123",
  "authorEmail": "abc123",
  "date": "abc123"
}
Response
{
  "data": {
    "resolvePhabricatorDiff": {
      "id": "4",
      "repository": Repository,
      "oid": GitObjectID,
      "abbreviatedOID": "xyz789",
      "perforceChangelist": PerforceChangelist,
      "author": Signature,
      "committer": Signature,
      "message": "xyz789",
      "subject": "xyz789",
      "body": "xyz789",
      "parents": [GitCommit],
      "url": "abc123",
      "canonicalURL": "abc123",
      "externalURLs": [ExternalLink],
      "path": GitTree,
      "tree": GitTree,
      "fileNames": ["xyz789"],
      "blob": GitBlob,
      "file": File2,
      "languages": ["xyz789"],
      "languageStatistics": [LanguageStatistics],
      "ancestors": GitCommitConnection,
      "behindAhead": BehindAheadCounts,
      "symbols": SymbolConnection,
      "diff": RepositoryComparison,
      "ownership": OwnershipConnection
    }
  }
}

respondToOrganizationInvitation

Description

Accept or reject an existing organization invitation.

Only the recipient of the invitation may perform this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
organizationInvitation - ID! The organization invitation.
responseType - OrganizationInvitationResponseType! The response to the invitation.

Example

Query
mutation respondToOrganizationInvitation(
  $organizationInvitation: ID!,
  $responseType: OrganizationInvitationResponseType!
) {
  respondToOrganizationInvitation(
    organizationInvitation: $organizationInvitation,
    responseType: $responseType
  ) {
    alwaysNil
  }
}
Variables
{"organizationInvitation": 4, "responseType": "ACCEPT"}
Response
{
  "data": {
    "respondToOrganizationInvitation": {
      "alwaysNil": "xyz789"
    }
  }
}

retryBatchSpecExecution

Description

Requeue all workspaces in the batch spec for execution. Previous results and logs will be deleted and the executions are replaced. The workspaces must be in a final state (COMPLETED, FAILED, CANCELED) to be retryable.

If includeCompleted is set, then workspaces that successfully completed execution will also be retried and their changeset specs deleted.

Response

Returns a BatchSpec!

Arguments
Name Description
batchSpec - ID!
includeCompleted - Boolean Default = false

Example

Query
mutation retryBatchSpecExecution(
  $batchSpec: ID!,
  $includeCompleted: Boolean
) {
  retryBatchSpecExecution(
    batchSpec: $batchSpec,
    includeCompleted: $includeCompleted
  ) {
    id
    autoApplyEnabled
    state
    originalInput
    parsedInput
    description {
      ...BatchChangeDescriptionFragment
    }
    applyPreview {
      ...ChangesetApplyPreviewConnectionFragment
    }
    changesetSpecs {
      ...ChangesetSpecConnectionFragment
    }
    creator {
      ...UserFragment
    }
    createdAt
    startedAt
    finishedAt
    namespace {
      ...NamespaceFragment
    }
    expiresAt
    applyURL
    viewerCanAdminister
    diffStat {
      ...DiffStatFragment
    }
    appliesToBatchChange {
      ...BatchChangeFragment
    }
    supersedingBatchSpec {
      ...BatchSpecFragment
    }
    viewerBatchChangesCodeHosts {
      ...BatchChangesCodeHostConnectionFragment
    }
    workspaceResolution {
      ...BatchSpecWorkspaceResolutionFragment
    }
    importingChangesets {
      ...ChangesetSpecConnectionFragment
    }
    failureMessage
    allowIgnored
    allowUnsupported
    noCache
    viewerCanRetry
    source
    files {
      ...BatchSpecWorkspaceFileConnectionFragment
    }
  }
}
Variables
{"batchSpec": 4, "includeCompleted": false}
Response
{
  "data": {
    "retryBatchSpecExecution": {
      "id": 4,
      "autoApplyEnabled": false,
      "state": "PENDING",
      "originalInput": "abc123",
      "parsedInput": JSONValue,
      "description": BatchChangeDescription,
      "applyPreview": ChangesetApplyPreviewConnection,
      "changesetSpecs": ChangesetSpecConnection,
      "creator": User,
      "createdAt": "2007-12-03T10:15:30Z",
      "startedAt": "2007-12-03T10:15:30Z",
      "finishedAt": "2007-12-03T10:15:30Z",
      "namespace": Namespace,
      "expiresAt": "2007-12-03T10:15:30Z",
      "applyURL": "abc123",
      "viewerCanAdminister": true,
      "diffStat": DiffStat,
      "appliesToBatchChange": BatchChange,
      "supersedingBatchSpec": BatchSpec,
      "viewerBatchChangesCodeHosts": BatchChangesCodeHostConnection,
      "workspaceResolution": BatchSpecWorkspaceResolution,
      "importingChangesets": ChangesetSpecConnection,
      "failureMessage": "abc123",
      "allowIgnored": false,
      "allowUnsupported": false,
      "noCache": true,
      "viewerCanRetry": false,
      "source": "LOCAL",
      "files": BatchSpecWorkspaceFileConnection
    }
  }
}

retryBatchSpecWorkspaceExecution

Description

Requeue the workspaces for execution. Previous results and logs will be deleted and the executions are replaced. The workspaces must be in a final state (COMPLETED, FAILED) to be retryable.

Response

Returns an EmptyResponse!

Arguments
Name Description
batchSpecWorkspaces - [ID!]!

Example

Query
mutation retryBatchSpecWorkspaceExecution($batchSpecWorkspaces: [ID!]!) {
  retryBatchSpecWorkspaceExecution(batchSpecWorkspaces: $batchSpecWorkspaces) {
    alwaysNil
  }
}
Variables
{"batchSpecWorkspaces": [4]}
Response
{
  "data": {
    "retryBatchSpecWorkspaceExecution": {
      "alwaysNil": "xyz789"
    }
  }
}

retryInsightSeriesBackfill

Description

Retry the backfill for a failed insight series given the graphql ID of the InsightBackfillQueueItem. Can only be used by a site admin.

Response

Returns an InsightBackfillQueueItem!

Arguments
Name Description
id - ID!

Example

Query
mutation retryInsightSeriesBackfill($id: ID!) {
  retryInsightSeriesBackfill(id: $id) {
    id
    insightViewTitle
    creator {
      ...UserFragment
    }
    seriesLabel
    seriesSearchQuery
    backfillQueueStatus {
      ...BackfillStatusFragment
    }
  }
}
Variables
{"id": 4}
Response
{
  "data": {
    "retryInsightSeriesBackfill": {
      "id": "4",
      "insightViewTitle": "xyz789",
      "creator": User,
      "seriesLabel": "abc123",
      "seriesSearchQuery": "abc123",
      "backfillQueueStatus": BackfillStatus
    }
  }
}

saveInsightAsNewView

Description

Create a new insight view from an existing view.

Response

Returns an InsightViewPayload!

Arguments
Name Description
input - SaveInsightAsNewViewInput!

Example

Query
mutation saveInsightAsNewView($input: SaveInsightAsNewViewInput!) {
  saveInsightAsNewView(input: $input) {
    view {
      ...InsightViewFragment
    }
  }
}
Variables
{"input": SaveInsightAsNewViewInput}
Response
{"data": {"saveInsightAsNewView": {"view": InsightView}}}

scheduleRepositoriesForEmbedding

Description

Experimental: Schedules a job to create an embedding search index for each listed repository. The indices are used for embeddings search. If force is set to true, then the repo will be re-embedded even if there's already an up-to-date embeddings index.

Response

Returns an EmptyResponse!

Arguments
Name Description
repoNames - [String!]!
force - Boolean

Example

Query
mutation scheduleRepositoriesForEmbedding(
  $repoNames: [String!]!,
  $force: Boolean
) {
  scheduleRepositoriesForEmbedding(
    repoNames: $repoNames,
    force: $force
  ) {
    alwaysNil
  }
}
Variables
{"repoNames": ["abc123"], "force": false}
Response
{
  "data": {
    "scheduleRepositoriesForEmbedding": {
      "alwaysNil": "xyz789"
    }
  }
}

sendTestEmail

Description

Sends an email for testing Sourcegraph's email configuration.

Only administrators can use this API.

Response

Returns a String!

Arguments
Name Description
to - String!

Example

Query
mutation sendTestEmail($to: String!) {
  sendTestEmail(to: $to)
}
Variables
{"to": "xyz789"}
Response
{"data": {"sendTestEmail": "abc123"}}

setAccessRequestStatus

Description

Marks access_request as rejected

Response

Returns an EmptyResponse

Arguments
Name Description
id - ID!
status - AccessRequestStatus!

Example

Query
mutation setAccessRequestStatus(
  $id: ID!,
  $status: AccessRequestStatus!
) {
  setAccessRequestStatus(
    id: $id,
    status: $status
  ) {
    alwaysNil
  }
}
Variables
{"id": 4, "status": "PENDING"}
Response
{
  "data": {
    "setAccessRequestStatus": {
      "alwaysNil": "abc123"
    }
  }
}

setAutoUpgrade

Description

INTERNAL ONLY: Sets the value of versions.auto_upgrade in the frontend db. Determines behavior of multiversion upgrades.

Only site admins may perform this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
enable - Boolean!

Example

Query
mutation setAutoUpgrade($enable: Boolean!) {
  setAutoUpgrade(enable: $enable) {
    alwaysNil
  }
}
Variables
{"enable": true}
Response
{
  "data": {
    "setAutoUpgrade": {
      "alwaysNil": "xyz789"
    }
  }
}

setCompletedPostSignup

Description

Sets the user to have completed the post-signup flow. If the ID is omitted, the current user is assumed.

Only the user or site admins may perform this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
userID - ID

Example

Query
mutation setCompletedPostSignup($userID: ID) {
  setCompletedPostSignup(userID: $userID) {
    alwaysNil
  }
}
Variables
{"userID": 4}
Response
{
  "data": {
    "setCompletedPostSignup": {
      "alwaysNil": "abc123"
    }
  }
}

setDefaultSearchContext

Description

Set the default search context for the specified user.

Response

Returns an EmptyResponse!

Arguments
Name Description
searchContextID - ID!
userID - ID!

Example

Query
mutation setDefaultSearchContext(
  $searchContextID: ID!,
  $userID: ID!
) {
  setDefaultSearchContext(
    searchContextID: $searchContextID,
    userID: $userID
  ) {
    alwaysNil
  }
}
Variables
{"searchContextID": "4", "userID": 4}
Response
{
  "data": {
    "setDefaultSearchContext": {
      "alwaysNil": "abc123"
    }
  }
}

setMigrationDirection

Description

Updates an out-of-band migration to run in a particular direction.

Applied in the forward direction, an out-of-band migration migrates data into a format that is readable by newer Sourcegraph instances. This may be destructive or non-destructive process, depending on the nature and implementation of the migration.

Applied in the reverse direction, an out-of-band migration ensures that data is moved back into a format that is readable by the previous Sourcegraph instance. Recently introduced migrations should be applied in reverse prior to downgrading the instance.

Response

Returns an EmptyResponse!

Arguments
Name Description
id - ID!
applyReverse - Boolean!

Example

Query
mutation setMigrationDirection(
  $id: ID!,
  $applyReverse: Boolean!
) {
  setMigrationDirection(
    id: $id,
    applyReverse: $applyReverse
  ) {
    alwaysNil
  }
}
Variables
{"id": 4, "applyReverse": true}
Response
{
  "data": {
    "setMigrationDirection": {
      "alwaysNil": "xyz789"
    }
  }
}

setPermissions

Description

Set permissions for role. This updates the permissions assigned to a role based on the permissions passed in the argument. Permissions already assigned to the role that aren't part of the arguments of this mutation will be revoked for the role.

Response

Returns an EmptyResponse!

Arguments
Name Description
role - ID!
permissions - [ID!]!

Example

Query
mutation setPermissions(
  $role: ID!,
  $permissions: [ID!]!
) {
  setPermissions(
    role: $role,
    permissions: $permissions
  ) {
    alwaysNil
  }
}
Variables
{"role": 4, "permissions": ["4"]}
Response
{
  "data": {
    "setPermissions": {
      "alwaysNil": "xyz789"
    }
  }
}

setRoles

Description

Set roles for a user. Similar to setPermissions, this updates the roles assigned to a user based on the roles passed in the argument. Permissions already assigned to the role that aren't part of the arguments of this mutation will be revoked for the role.

Response

Returns an EmptyResponse!

Arguments
Name Description
user - ID!
roles - [ID!]!

Example

Query
mutation setRoles(
  $user: ID!,
  $roles: [ID!]!
) {
  setRoles(
    user: $user,
    roles: $roles
  ) {
    alwaysNil
  }
}
Variables
{"user": "4", "roles": [4]}
Response
{
  "data": {
    "setRoles": {"alwaysNil": "xyz789"}
  }
}

setTeamMembers

Description

This is a convenience method to forcefully overwrite the full set of members of a team. This is handy to sync external state without diffing the current members vs the desired set of members.

Either team XOR teamName can be specified to specify the team. Must be team member to modify team members, or site-admin.

For now, members can only be the IDs of User entities in Sourcegraph. Later, we will expand this to allow Persons as well.

If skipUnmatchedMembers is true, members that are not matched to a user are skipped.

Response

Returns a Team!

Arguments
Name Description
team - ID
teamName - String
members - [TeamMemberInput!]!
skipUnmatchedMembers - Boolean Default = false

Example

Query
mutation setTeamMembers(
  $team: ID,
  $teamName: String,
  $members: [TeamMemberInput!]!,
  $skipUnmatchedMembers: Boolean
) {
  setTeamMembers(
    team: $team,
    teamName: $teamName,
    members: $members,
    skipUnmatchedMembers: $skipUnmatchedMembers
  ) {
    id
    name
    url
    avatarURL
    displayName
    readonly
    members {
      ...TeamMemberConnectionFragment
    }
    parentTeam {
      ...TeamFragment
    }
    childTeams {
      ...TeamConnectionFragment
    }
    viewerCanAdminister
    creator {
      ...UserFragment
    }
    external
  }
}
Variables
{
  "team": "4",
  "teamName": "abc123",
  "members": [TeamMemberInput],
  "skipUnmatchedMembers": false
}
Response
{
  "data": {
    "setTeamMembers": {
      "id": "4",
      "name": "abc123",
      "url": "xyz789",
      "avatarURL": "abc123",
      "displayName": "xyz789",
      "readonly": true,
      "members": TeamMemberConnection,
      "parentTeam": Team,
      "childTeams": TeamConnection,
      "viewerCanAdminister": false,
      "creator": User,
      "external": false
    }
  }
}

setTosAccepted

Description

Sets the user to accept the site's Terms of Service and Privacy Policy. If the ID is omitted, the current user is assumed.

Only the user or site admins may perform this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
userID - ID

Example

Query
mutation setTosAccepted($userID: ID) {
  setTosAccepted(userID: $userID) {
    alwaysNil
  }
}
Variables
{"userID": "4"}
Response
{
  "data": {
    "setTosAccepted": {
      "alwaysNil": "xyz789"
    }
  }
}

setUserCodeCompletionsQuota

Description

Sets the code completions requests quota for the user per day. Quota: Null means use the default quota.

Response

Returns a User!

Arguments
Name Description
user - ID!
quota - Int

Example

Query
mutation setUserCodeCompletionsQuota(
  $user: ID!,
  $quota: Int
) {
  setUserCodeCompletionsQuota(
    user: $user,
    quota: $quota
  ) {
    executorSecrets {
      ...ExecutorSecretConnectionFragment
    }
    id
    username
    email
    displayName
    avatarURL
    url
    settingsURL
    createdAt
    updatedAt
    siteAdmin
    builtinAuth
    latestSettings {
      ...SettingsFragment
    }
    settingsCascade {
      ...SettingsCascadeFragment
    }
    configurationCascade {
      ...ConfigurationCascadeFragment
    }
    organizations {
      ...OrgConnectionFragment
    }
    organizationMemberships {
      ...OrganizationMembershipConnectionFragment
    }
    tosAccepted
    usageStatistics {
      ...UserUsageStatisticsFragment
    }
    eventLogs {
      ...EventLogsConnectionFragment
    }
    emails {
      ...UserEmailFragment
    }
    hasVerifiedEmail
    completedPostSignup
    primaryEmail {
      ...UserEmailFragment
    }
    accessTokens {
      ...AccessTokenConnectionFragment
    }
    externalAccounts {
      ...ExternalAccountConnectionFragment
    }
    session {
      ...SessionFragment
    }
    viewerCanAdminister
    viewerCanChangeUsername
    surveyResponses {
      ...SurveyResponseFragment
    }
    databaseID
    namespaceName
    scimControlled
    roles {
      ...RoleConnectionFragment
    }
    permissions {
      ...PermissionConnectionFragment
    }
    completionsQuotaOverride
    codeCompletionsQuotaOverride
    codySubscription {
      ...CodySubscriptionFragment
    }
    codyProEnabled
    codyCurrentPeriodChatUsage
    codyCurrentPeriodCodeUsage
    codyCurrentPeriodChatLimit
    codyCurrentPeriodCodeLimit
    teams {
      ...TeamConnectionFragment
    }
    batchChanges {
      ...BatchChangeConnectionFragment
    }
    batchChangesCodeHosts {
      ...BatchChangesCodeHostConnectionFragment
    }
  }
}
Variables
{"user": 4, "quota": 987}
Response
{
  "data": {
    "setUserCodeCompletionsQuota": {
      "executorSecrets": ExecutorSecretConnection,
      "id": "4",
      "username": "abc123",
      "email": "xyz789",
      "displayName": "abc123",
      "avatarURL": "abc123",
      "url": "xyz789",
      "settingsURL": "abc123",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "siteAdmin": true,
      "builtinAuth": false,
      "latestSettings": Settings,
      "settingsCascade": SettingsCascade,
      "configurationCascade": ConfigurationCascade,
      "organizations": OrgConnection,
      "organizationMemberships": OrganizationMembershipConnection,
      "tosAccepted": true,
      "usageStatistics": UserUsageStatistics,
      "eventLogs": EventLogsConnection,
      "emails": [UserEmail],
      "hasVerifiedEmail": true,
      "completedPostSignup": false,
      "primaryEmail": UserEmail,
      "accessTokens": AccessTokenConnection,
      "externalAccounts": ExternalAccountConnection,
      "session": Session,
      "viewerCanAdminister": false,
      "viewerCanChangeUsername": true,
      "surveyResponses": [SurveyResponse],
      "databaseID": 123,
      "namespaceName": "abc123",
      "scimControlled": true,
      "roles": RoleConnection,
      "permissions": PermissionConnection,
      "completionsQuotaOverride": 987,
      "codeCompletionsQuotaOverride": 987,
      "codySubscription": CodySubscription,
      "codyProEnabled": true,
      "codyCurrentPeriodChatUsage": 987,
      "codyCurrentPeriodCodeUsage": 123,
      "codyCurrentPeriodChatLimit": 123,
      "codyCurrentPeriodCodeLimit": 987,
      "teams": TeamConnection,
      "batchChanges": BatchChangeConnection,
      "batchChangesCodeHosts": BatchChangesCodeHostConnection
    }
  }
}

setUserCompletionsQuota

Description

Sets the completions requests quota for the user per day. Quota: Null means use the default quota.

Response

Returns a User!

Arguments
Name Description
user - ID!
quota - Int

Example

Query
mutation setUserCompletionsQuota(
  $user: ID!,
  $quota: Int
) {
  setUserCompletionsQuota(
    user: $user,
    quota: $quota
  ) {
    executorSecrets {
      ...ExecutorSecretConnectionFragment
    }
    id
    username
    email
    displayName
    avatarURL
    url
    settingsURL
    createdAt
    updatedAt
    siteAdmin
    builtinAuth
    latestSettings {
      ...SettingsFragment
    }
    settingsCascade {
      ...SettingsCascadeFragment
    }
    configurationCascade {
      ...ConfigurationCascadeFragment
    }
    organizations {
      ...OrgConnectionFragment
    }
    organizationMemberships {
      ...OrganizationMembershipConnectionFragment
    }
    tosAccepted
    usageStatistics {
      ...UserUsageStatisticsFragment
    }
    eventLogs {
      ...EventLogsConnectionFragment
    }
    emails {
      ...UserEmailFragment
    }
    hasVerifiedEmail
    completedPostSignup
    primaryEmail {
      ...UserEmailFragment
    }
    accessTokens {
      ...AccessTokenConnectionFragment
    }
    externalAccounts {
      ...ExternalAccountConnectionFragment
    }
    session {
      ...SessionFragment
    }
    viewerCanAdminister
    viewerCanChangeUsername
    surveyResponses {
      ...SurveyResponseFragment
    }
    databaseID
    namespaceName
    scimControlled
    roles {
      ...RoleConnectionFragment
    }
    permissions {
      ...PermissionConnectionFragment
    }
    completionsQuotaOverride
    codeCompletionsQuotaOverride
    codySubscription {
      ...CodySubscriptionFragment
    }
    codyProEnabled
    codyCurrentPeriodChatUsage
    codyCurrentPeriodCodeUsage
    codyCurrentPeriodChatLimit
    codyCurrentPeriodCodeLimit
    teams {
      ...TeamConnectionFragment
    }
    batchChanges {
      ...BatchChangeConnectionFragment
    }
    batchChangesCodeHosts {
      ...BatchChangesCodeHostConnectionFragment
    }
  }
}
Variables
{"user": "4", "quota": 987}
Response
{
  "data": {
    "setUserCompletionsQuota": {
      "executorSecrets": ExecutorSecretConnection,
      "id": 4,
      "username": "abc123",
      "email": "abc123",
      "displayName": "abc123",
      "avatarURL": "xyz789",
      "url": "abc123",
      "settingsURL": "xyz789",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "siteAdmin": false,
      "builtinAuth": true,
      "latestSettings": Settings,
      "settingsCascade": SettingsCascade,
      "configurationCascade": ConfigurationCascade,
      "organizations": OrgConnection,
      "organizationMemberships": OrganizationMembershipConnection,
      "tosAccepted": true,
      "usageStatistics": UserUsageStatistics,
      "eventLogs": EventLogsConnection,
      "emails": [UserEmail],
      "hasVerifiedEmail": true,
      "completedPostSignup": false,
      "primaryEmail": UserEmail,
      "accessTokens": AccessTokenConnection,
      "externalAccounts": ExternalAccountConnection,
      "session": Session,
      "viewerCanAdminister": false,
      "viewerCanChangeUsername": true,
      "surveyResponses": [SurveyResponse],
      "databaseID": 123,
      "namespaceName": "xyz789",
      "scimControlled": true,
      "roles": RoleConnection,
      "permissions": PermissionConnection,
      "completionsQuotaOverride": 987,
      "codeCompletionsQuotaOverride": 123,
      "codySubscription": CodySubscription,
      "codyProEnabled": false,
      "codyCurrentPeriodChatUsage": 123,
      "codyCurrentPeriodCodeUsage": 987,
      "codyCurrentPeriodChatLimit": 987,
      "codyCurrentPeriodCodeLimit": 123,
      "teams": TeamConnection,
      "batchChanges": BatchChangeConnection,
      "batchChangesCodeHosts": BatchChangesCodeHostConnection
    }
  }
}

setUserEmailPrimary

Description

Set an email address as the user's primary.

Only the user and site admins may perform this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
user - ID!
email - String!

Example

Query
mutation setUserEmailPrimary(
  $user: ID!,
  $email: String!
) {
  setUserEmailPrimary(
    user: $user,
    email: $email
  ) {
    alwaysNil
  }
}
Variables
{"user": 4, "email": "xyz789"}
Response
{
  "data": {
    "setUserEmailPrimary": {
      "alwaysNil": "abc123"
    }
  }
}

setUserEmailVerified

Description

Manually set the verification status of a user's email, without going through the normal verification process (of clicking on a link in the email with a verification code).

Only site admins may perform this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
user - ID!
email - String!
verified - Boolean!

Example

Query
mutation setUserEmailVerified(
  $user: ID!,
  $email: String!,
  $verified: Boolean!
) {
  setUserEmailVerified(
    user: $user,
    email: $email,
    verified: $verified
  ) {
    alwaysNil
  }
}
Variables
{
  "user": "4",
  "email": "xyz789",
  "verified": true
}
Response
{
  "data": {
    "setUserEmailVerified": {
      "alwaysNil": "abc123"
    }
  }
}

setUserIsSiteAdmin

Description

Sets whether the user with the specified user ID is a site admin.

Only site admins may perform this mutation.

Response

Returns an EmptyResponse

Arguments
Name Description
userID - ID!
siteAdmin - Boolean!

Example

Query
mutation setUserIsSiteAdmin(
  $userID: ID!,
  $siteAdmin: Boolean!
) {
  setUserIsSiteAdmin(
    userID: $userID,
    siteAdmin: $siteAdmin
  ) {
    alwaysNil
  }
}
Variables
{"userID": "4", "siteAdmin": false}
Response
{
  "data": {
    "setUserIsSiteAdmin": {
      "alwaysNil": "abc123"
    }
  }
}

settingsMutation

Description

All mutations that update settings (global, organization, and user settings) are under this field.

Only the settings subject whose settings are being mutated (and site admins) may perform this mutation.

This mutation only affects global, organization, and user settings, not site configuration. For site configuration (which is a separate set of configuration properties from global/organization/user settings), use updateSiteConfiguration.

Response

Returns a SettingsMutation

Arguments
Name Description
input - SettingsMutationGroupInput!

Example

Query
mutation settingsMutation($input: SettingsMutationGroupInput!) {
  settingsMutation(input: $input) {
    editSettings {
      ...UpdateSettingsPayloadFragment
    }
    editConfiguration {
      ...UpdateSettingsPayloadFragment
    }
    overwriteSettings {
      ...UpdateSettingsPayloadFragment
    }
  }
}
Variables
{"input": SettingsMutationGroupInput}
Response
{
  "data": {
    "settingsMutation": {
      "editSettings": UpdateSettingsPayload,
      "editConfiguration": UpdateSettingsPayload,
      "overwriteSettings": UpdateSettingsPayload
    }
  }
}

submitCodySurvey

Description

Submits a post-signup user survey about intended Cody usage.

Response

Returns an EmptyResponse!

Arguments
Name Description
isForWork - Boolean!
isForPersonal - Boolean!

Example

Query
mutation submitCodySurvey(
  $isForWork: Boolean!,
  $isForPersonal: Boolean!
) {
  submitCodySurvey(
    isForWork: $isForWork,
    isForPersonal: $isForPersonal
  ) {
    alwaysNil
  }
}
Variables
{"isForWork": true, "isForPersonal": true}
Response
{
  "data": {
    "submitCodySurvey": {
      "alwaysNil": "xyz789"
    }
  }
}

submitHappinessFeedback

Description

Submits happiness feedback.

Response

Returns an EmptyResponse

Arguments
Name Description
input - HappinessFeedbackSubmissionInput!

Example

Query
mutation submitHappinessFeedback($input: HappinessFeedbackSubmissionInput!) {
  submitHappinessFeedback(input: $input) {
    alwaysNil
  }
}
Variables
{"input": HappinessFeedbackSubmissionInput}
Response
{
  "data": {
    "submitHappinessFeedback": {
      "alwaysNil": "abc123"
    }
  }
}

submitSurvey

Description

Submits a user satisfaction (NPS) survey.

Response

Returns an EmptyResponse

Arguments
Name Description
input - SurveySubmissionInput!

Example

Query
mutation submitSurvey($input: SurveySubmissionInput!) {
  submitSurvey(input: $input) {
    alwaysNil
  }
}
Variables
{"input": SurveySubmissionInput}
Response
{
  "data": {
    "submitSurvey": {"alwaysNil": "xyz789"}
  }
}

syncChangeset

Description

Enqueue the given changeset for high-priority syncing.

Response

Returns an EmptyResponse!

Arguments
Name Description
changeset - ID!

Example

Query
mutation syncChangeset($changeset: ID!) {
  syncChangeset(changeset: $changeset) {
    alwaysNil
  }
}
Variables
{"changeset": 4}
Response
{
  "data": {
    "syncChangeset": {"alwaysNil": "abc123"}
  }
}

syncExternalService

Description

Enqueues a sync for the external service. It will be picked up in the background.

Site-admin or owner of the external service only.

Response

Returns an EmptyResponse!

Arguments
Name Description
id - ID!

Example

Query
mutation syncExternalService($id: ID!) {
  syncExternalService(id: $id) {
    alwaysNil
  }
}
Variables
{"id": "4"}
Response
{
  "data": {
    "syncExternalService": {
      "alwaysNil": "xyz789"
    }
  }
}

telemetry

Description

Telemetry mutations for "Event Logging Everywhere", aka a version 2 of existing event-logging/event-recording APIs.

Response

Returns a TelemetryMutation!

Example

Query
mutation telemetry {
  telemetry {
    recordEvents {
      ...EmptyResponseFragment
    }
  }
}
Response
{"data": {"telemetry": {"recordEvents": EmptyResponse}}}

toggleBatchSpecAutoApply

Description

Sets the autoApplyEnabled on the given batch spec. Must be in PROCESSING state.

TODO: Not implemented yet.

Response

Returns a BatchSpec!

Arguments
Name Description
batchSpec - ID!
value - Boolean!

Example

Query
mutation toggleBatchSpecAutoApply(
  $batchSpec: ID!,
  $value: Boolean!
) {
  toggleBatchSpecAutoApply(
    batchSpec: $batchSpec,
    value: $value
  ) {
    id
    autoApplyEnabled
    state
    originalInput
    parsedInput
    description {
      ...BatchChangeDescriptionFragment
    }
    applyPreview {
      ...ChangesetApplyPreviewConnectionFragment
    }
    changesetSpecs {
      ...ChangesetSpecConnectionFragment
    }
    creator {
      ...UserFragment
    }
    createdAt
    startedAt
    finishedAt
    namespace {
      ...NamespaceFragment
    }
    expiresAt
    applyURL
    viewerCanAdminister
    diffStat {
      ...DiffStatFragment
    }
    appliesToBatchChange {
      ...BatchChangeFragment
    }
    supersedingBatchSpec {
      ...BatchSpecFragment
    }
    viewerBatchChangesCodeHosts {
      ...BatchChangesCodeHostConnectionFragment
    }
    workspaceResolution {
      ...BatchSpecWorkspaceResolutionFragment
    }
    importingChangesets {
      ...ChangesetSpecConnectionFragment
    }
    failureMessage
    allowIgnored
    allowUnsupported
    noCache
    viewerCanRetry
    source
    files {
      ...BatchSpecWorkspaceFileConnectionFragment
    }
  }
}
Variables
{"batchSpec": "4", "value": false}
Response
{
  "data": {
    "toggleBatchSpecAutoApply": {
      "id": "4",
      "autoApplyEnabled": true,
      "state": "PENDING",
      "originalInput": "xyz789",
      "parsedInput": JSONValue,
      "description": BatchChangeDescription,
      "applyPreview": ChangesetApplyPreviewConnection,
      "changesetSpecs": ChangesetSpecConnection,
      "creator": User,
      "createdAt": "2007-12-03T10:15:30Z",
      "startedAt": "2007-12-03T10:15:30Z",
      "finishedAt": "2007-12-03T10:15:30Z",
      "namespace": Namespace,
      "expiresAt": "2007-12-03T10:15:30Z",
      "applyURL": "abc123",
      "viewerCanAdminister": true,
      "diffStat": DiffStat,
      "appliesToBatchChange": BatchChange,
      "supersedingBatchSpec": BatchSpec,
      "viewerBatchChangesCodeHosts": BatchChangesCodeHostConnection,
      "workspaceResolution": BatchSpecWorkspaceResolution,
      "importingChangesets": ChangesetSpecConnection,
      "failureMessage": "abc123",
      "allowIgnored": false,
      "allowUnsupported": false,
      "noCache": false,
      "viewerCanRetry": false,
      "source": "LOCAL",
      "files": BatchSpecWorkspaceFileConnection
    }
  }
}

triggerObservabilityTestAlert

Description

OBSERVABILITY

Set the status of a test alert of the specified parameters - useful for validating 'observability.alerts' configuration. Alerts may take up to a minute to fire.

Response

Returns an EmptyResponse!

Arguments
Name Description
level - String! Level of alert to test - either warning or critical.

Example

Query
mutation triggerObservabilityTestAlert($level: String!) {
  triggerObservabilityTestAlert(level: $level) {
    alwaysNil
  }
}
Variables
{"level": "xyz789"}
Response
{
  "data": {
    "triggerObservabilityTestAlert": {
      "alwaysNil": "abc123"
    }
  }
}

updateCodeIntelligenceConfigurationPolicy

Description

Updates the attributes configuration policy with the given identifier.

Response

Returns an EmptyResponse

Arguments
Name Description
id - ID!
repositoryPatterns - [String!]
name - String!
type - GitObjectType!
pattern - String!
retentionEnabled - Boolean!
retentionDurationHours - Int
retainIntermediateCommits - Boolean!
indexingEnabled - Boolean!
indexCommitMaxAgeHours - Int
indexIntermediateCommits - Boolean!
embeddingsEnabled - Boolean embeddingsEnabled, if not provided, currently defaults to false.

Example

Query
mutation updateCodeIntelligenceConfigurationPolicy(
  $id: ID!,
  $repositoryPatterns: [String!],
  $name: String!,
  $type: GitObjectType!,
  $pattern: String!,
  $retentionEnabled: Boolean!,
  $retentionDurationHours: Int,
  $retainIntermediateCommits: Boolean!,
  $indexingEnabled: Boolean!,
  $indexCommitMaxAgeHours: Int,
  $indexIntermediateCommits: Boolean!,
  $embeddingsEnabled: Boolean
) {
  updateCodeIntelligenceConfigurationPolicy(
    id: $id,
    repositoryPatterns: $repositoryPatterns,
    name: $name,
    type: $type,
    pattern: $pattern,
    retentionEnabled: $retentionEnabled,
    retentionDurationHours: $retentionDurationHours,
    retainIntermediateCommits: $retainIntermediateCommits,
    indexingEnabled: $indexingEnabled,
    indexCommitMaxAgeHours: $indexCommitMaxAgeHours,
    indexIntermediateCommits: $indexIntermediateCommits,
    embeddingsEnabled: $embeddingsEnabled
  ) {
    alwaysNil
  }
}
Variables
{
  "id": "4",
  "repositoryPatterns": ["abc123"],
  "name": "xyz789",
  "type": "GIT_COMMIT",
  "pattern": "abc123",
  "retentionEnabled": false,
  "retentionDurationHours": 987,
  "retainIntermediateCommits": false,
  "indexingEnabled": false,
  "indexCommitMaxAgeHours": 123,
  "indexIntermediateCommits": true,
  "embeddingsEnabled": false
}
Response
{
  "data": {
    "updateCodeIntelligenceConfigurationPolicy": {
      "alwaysNil": "abc123"
    }
  }
}

updateCodeIntelligenceInferenceScript

Description

Updates the previously set/overrides the default global auto-indexing job inference Lua script with a new override.

Response

Returns an EmptyResponse

Arguments
Name Description
script - String!

Example

Query
mutation updateCodeIntelligenceInferenceScript($script: String!) {
  updateCodeIntelligenceInferenceScript(script: $script) {
    alwaysNil
  }
}
Variables
{"script": "abc123"}
Response
{
  "data": {
    "updateCodeIntelligenceInferenceScript": {
      "alwaysNil": "abc123"
    }
  }
}

updateCodeownersFile

Description

updateCodeownersFile updates an existing Codeowners file for a repository.

Response

Returns a CodeownersIngestedFile!

Arguments
Name Description
input - CodeownersFileInput!

Example

Query
mutation updateCodeownersFile($input: CodeownersFileInput!) {
  updateCodeownersFile(input: $input) {
    id
    contents
    repository {
      ...RepositoryFragment
    }
    createdAt
    updatedAt
  }
}
Variables
{"input": CodeownersFileInput}
Response
{
  "data": {
    "updateCodeownersFile": {
      "id": 4,
      "contents": "abc123",
      "repository": Repository,
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z"
    }
  }
}

updateExecutorSecret

Description

Update the value of an existing executor secret.

Response

Returns an ExecutorSecret!

Arguments
Name Description
scope - ExecutorSecretScope! The scope of the secret.
id - ID! The identifier of the secret that shall be updated.
value - String! The new secret value.

Example

Query
mutation updateExecutorSecret(
  $scope: ExecutorSecretScope!,
  $id: ID!,
  $value: String!
) {
  updateExecutorSecret(
    scope: $scope,
    id: $id,
    value: $value
  ) {
    id
    key
    scope
    overwritesGlobalSecret
    namespace {
      ...NamespaceFragment
    }
    creator {
      ...UserFragment
    }
    createdAt
    updatedAt
    accessLogs {
      ...ExecutorSecretAccessLogConnectionFragment
    }
  }
}
Variables
{
  "scope": "BATCHES",
  "id": 4,
  "value": "xyz789"
}
Response
{
  "data": {
    "updateExecutorSecret": {
      "id": "4",
      "key": "xyz789",
      "scope": "BATCHES",
      "overwritesGlobalSecret": false,
      "namespace": Namespace,
      "creator": User,
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "accessLogs": ExecutorSecretAccessLogConnection
    }
  }
}

updateExternalService

Description

Updates a external service. Only site admins may perform this mutation.

Response

Returns an ExternalService!

Arguments
Name Description
input - UpdateExternalServiceInput!

Example

Query
mutation updateExternalService($input: UpdateExternalServiceInput!) {
  updateExternalService(input: $input) {
    id
    kind
    displayName
    rateLimiterState {
      ...RateLimiterStateFragment
    }
    config
    createdAt
    updatedAt
    repoCount
    webhookURL
    warning
    lastSyncError
    lastSyncAt
    nextSyncAt
    creator {
      ...UserFragment
    }
    lastUpdater {
      ...UserFragment
    }
    webhookLogs {
      ...WebhookLogConnectionFragment
    }
    syncJobs {
      ...ExternalServiceSyncJobConnectionFragment
    }
    checkConnection {
      ... on ExternalServiceAvailable {
        ...ExternalServiceAvailableFragment
      }
      ... on ExternalServiceUnavailable {
        ...ExternalServiceUnavailableFragment
      }
      ... on ExternalServiceAvailabilityUnknown {
        ...ExternalServiceAvailabilityUnknownFragment
      }
    }
    hasConnectionCheck
    supportsRepoExclusion
    unrestricted
  }
}
Variables
{"input": UpdateExternalServiceInput}
Response
{
  "data": {
    "updateExternalService": {
      "id": "4",
      "kind": "AWSCODECOMMIT",
      "displayName": "abc123",
      "rateLimiterState": RateLimiterState,
      "config": JSONCString,
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "repoCount": 987,
      "webhookURL": "abc123",
      "warning": "xyz789",
      "lastSyncError": "xyz789",
      "lastSyncAt": "2007-12-03T10:15:30Z",
      "nextSyncAt": "2007-12-03T10:15:30Z",
      "creator": User,
      "lastUpdater": User,
      "webhookLogs": WebhookLogConnection,
      "syncJobs": ExternalServiceSyncJobConnection,
      "checkConnection": ExternalServiceAvailable,
      "hasConnectionCheck": false,
      "supportsRepoExclusion": true,
      "unrestricted": true
    }
  }
}

updateFeatureFlag

Description

EXPERIMENTAL: Update a feature flag

Response

Returns a FeatureFlag!

Arguments
Name Description
name - String! The name of the feature flag
value - Boolean The value of the feature flag. Only set if the new feature flag will be a concrete boolean flag. Mutually exclusive with rollout.
rolloutBasisPoints - Int The ratio of users the feature flag will apply to, expressed in basis points (0.01%). Mutually exclusive with value.

Example

Query
mutation updateFeatureFlag(
  $name: String!,
  $value: Boolean,
  $rolloutBasisPoints: Int
) {
  updateFeatureFlag(
    name: $name,
    value: $value,
    rolloutBasisPoints: $rolloutBasisPoints
  ) {
    ... on FeatureFlagBoolean {
      ...FeatureFlagBooleanFragment
    }
    ... on FeatureFlagRollout {
      ...FeatureFlagRolloutFragment
    }
  }
}
Variables
{
  "name": "xyz789",
  "value": true,
  "rolloutBasisPoints": 123
}
Response
{"data": {"updateFeatureFlag": FeatureFlagBoolean}}

updateFeatureFlagOverride

Description

Update a feature flag override

Response

Returns a FeatureFlagOverride!

Arguments
Name Description
id - ID! The ID of the feature flag override to update
value - Boolean! The updated value of the feature flag override

Example

Query
mutation updateFeatureFlagOverride(
  $id: ID!,
  $value: Boolean!
) {
  updateFeatureFlagOverride(
    id: $id,
    value: $value
  ) {
    id
    namespace {
      ...NamespaceFragment
    }
    targetFlag {
      ... on FeatureFlagBoolean {
        ...FeatureFlagBooleanFragment
      }
      ... on FeatureFlagRollout {
        ...FeatureFlagRolloutFragment
      }
    }
    value
  }
}
Variables
{"id": 4, "value": false}
Response
{
  "data": {
    "updateFeatureFlagOverride": {
      "id": 4,
      "namespace": Namespace,
      "targetFlag": FeatureFlagBoolean,
      "value": false
    }
  }
}

updateInsightSeries

Description

Update an insight series. Restricted to admins only.

Response

Returns an InsightSeriesMetadataPayload

Arguments
Name Description
input - UpdateInsightSeriesInput!

Example

Query
mutation updateInsightSeries($input: UpdateInsightSeriesInput!) {
  updateInsightSeries(input: $input) {
    series {
      ...InsightSeriesMetadataFragment
    }
  }
}
Variables
{"input": UpdateInsightSeriesInput}
Response
{
  "data": {
    "updateInsightSeries": {
      "series": InsightSeriesMetadata
    }
  }
}

updateInsightsDashboard

Description

Edit an existing dashboard.

Response

Returns an InsightsDashboardPayload!

Arguments
Name Description
id - ID!
input - UpdateInsightsDashboardInput!

Example

Query
mutation updateInsightsDashboard(
  $id: ID!,
  $input: UpdateInsightsDashboardInput!
) {
  updateInsightsDashboard(
    id: $id,
    input: $input
  ) {
    dashboard {
      ...InsightsDashboardFragment
    }
  }
}
Variables
{
  "id": "4",
  "input": UpdateInsightsDashboardInput
}
Response
{
  "data": {
    "updateInsightsDashboard": {
      "dashboard": InsightsDashboard
    }
  }
}

updateLineChartSearchInsight

Description

Update a line chart backed by search insights.

Response

Returns an InsightViewPayload!

Arguments
Name Description
id - ID!
input - UpdateLineChartSearchInsightInput!

Example

Query
mutation updateLineChartSearchInsight(
  $id: ID!,
  $input: UpdateLineChartSearchInsightInput!
) {
  updateLineChartSearchInsight(
    id: $id,
    input: $input
  ) {
    view {
      ...InsightViewFragment
    }
  }
}
Variables
{
  "id": "4",
  "input": UpdateLineChartSearchInsightInput
}
Response
{
  "data": {
    "updateLineChartSearchInsight": {"view": InsightView}
  }
}

updateMirrorRepository

Description

Schedule the mirror repository to be updated from its original source repository. Updating occurs automatically, so this should not normally be needed.

Only site admins may perform this mutation.

Response

Returns an EmptyResponse!

Arguments
Name Description
repository - ID! The mirror repository to update.

Example

Query
mutation updateMirrorRepository($repository: ID!) {
  updateMirrorRepository(repository: $repository) {
    alwaysNil
  }
}
Variables
{"repository": 4}
Response
{
  "data": {
    "updateMirrorRepository": {
      "alwaysNil": "abc123"
    }
  }
}

updateNotebook

Description

Update a notebook. Only the owner can update it.

Response

Returns a Notebook!

Arguments
Name Description
id - ID! Notebook ID.
notebook - NotebookInput! Notebook input.

Example

Query
mutation updateNotebook(
  $id: ID!,
  $notebook: NotebookInput!
) {
  updateNotebook(
    id: $id,
    notebook: $notebook
  ) {
    id
    title
    blocks {
      ... on MarkdownBlock {
        ...MarkdownBlockFragment
      }
      ... on QueryBlock {
        ...QueryBlockFragment
      }
      ... on FileBlock {
        ...FileBlockFragment
      }
      ... on SymbolBlock {
        ...SymbolBlockFragment
      }
    }
    creator {
      ...UserFragment
    }
    updater {
      ...UserFragment
    }
    namespace {
      ...NamespaceFragment
    }
    public
    updatedAt
    createdAt
    viewerCanManage
    viewerHasStarred
    stars {
      ...NotebookStarConnectionFragment
    }
  }
}
Variables
{"id": 4, "notebook": NotebookInput}
Response
{
  "data": {
    "updateNotebook": {
      "id": 4,
      "title": "abc123",
      "blocks": [MarkdownBlock],
      "creator": User,
      "updater": User,
      "namespace": Namespace,
      "public": true,
      "updatedAt": "2007-12-03T10:15:30Z",
      "createdAt": "2007-12-03T10:15:30Z",
      "viewerCanManage": true,
      "viewerHasStarred": true,
      "stars": NotebookStarConnection
    }
  }
}

updateOnboardingTourContent

Description

(experimental) Updates the current onboarding tour content.

Response

Returns an EmptyResponse!

Arguments
Name Description
input - String!

Example

Query
mutation updateOnboardingTourContent($input: String!) {
  updateOnboardingTourContent(input: $input) {
    alwaysNil
  }
}
Variables
{"input": "abc123"}
Response
{
  "data": {
    "updateOnboardingTourContent": {
      "alwaysNil": "abc123"
    }
  }
}

updateOrganization

Description

Updates an organization.

Only site admins and any member of the organization may perform this mutation.

Response

Returns an Org!

Arguments
Name Description
id - ID!
displayName - String

Example

Query
mutation updateOrganization(
  $id: ID!,
  $displayName: String
) {
  updateOrganization(
    id: $id,
    displayName: $displayName
  ) {
    executorSecrets {
      ...ExecutorSecretConnectionFragment
    }
    id
    name
    displayName
    createdAt
    members {
      ...NewUsersConnectionFragment
    }
    latestSettings {
      ...SettingsFragment
    }
    settingsCascade {
      ...SettingsCascadeFragment
    }
    configurationCascade {
      ...ConfigurationCascadeFragment
    }
    viewerPendingInvitation {
      ...OrganizationInvitationFragment
    }
    viewerCanAdminister
    viewerIsMember
    url
    settingsURL
    namespaceName
    batchChanges {
      ...BatchChangeConnectionFragment
    }
  }
}
Variables
{
  "id": "4",
  "displayName": "xyz789"
}
Response
{
  "data": {
    "updateOrganization": {
      "executorSecrets": ExecutorSecretConnection,
      "id": "4",
      "name": "abc123",
      "displayName": "xyz789",
      "createdAt": "2007-12-03T10:15:30Z",
      "members": NewUsersConnection,
      "latestSettings": Settings,
      "settingsCascade": SettingsCascade,
      "configurationCascade": ConfigurationCascade,
      "viewerPendingInvitation": OrganizationInvitation,
      "viewerCanAdminister": false,
      "viewerIsMember": false,
      "url": "abc123",
      "settingsURL": "abc123",
      "namespaceName": "xyz789",
      "batchChanges": BatchChangeConnection
    }
  }
}

updateOutboundWebhook

Description

Updates an outbound webhook.

Only site admins have access to this mutation.

Response

Returns an OutboundWebhook!

Arguments
Name Description
id - ID!
input - OutboundWebhookUpdateInput!

Example

Query
mutation updateOutboundWebhook(
  $id: ID!,
  $input: OutboundWebhookUpdateInput!
) {
  updateOutboundWebhook(
    id: $id,
    input: $input
  ) {
    id
    url
    eventTypes {
      ...OutboundWebhookScopedEventTypeFragment
    }
    stats {
      ...OutboundWebhookLogStatsFragment
    }
    logs {
      ...OutboundWebhookLogConnectionFragment
    }
  }
}
Variables
{"id": 4, "input": OutboundWebhookUpdateInput}
Response
{
  "data": {
    "updateOutboundWebhook": {
      "id": 4,
      "url": "abc123",
      "eventTypes": [OutboundWebhookScopedEventType],
      "stats": OutboundWebhookLogStats,
      "logs": OutboundWebhookLogConnection
    }
  }
}

updateOwnSignalConfigurations

Description

updateOwnSignalConfigurations updates any configurations keyed by name. It will do nothing if the key doesn't exist.

Response

Returns [OwnSignalConfiguration!]!

Arguments
Name Description
input - UpdateSignalConfigurationsInput!

Example

Query
mutation updateOwnSignalConfigurations($input: UpdateSignalConfigurationsInput!) {
  updateOwnSignalConfigurations(input: $input) {
    name
    description
    isEnabled
    excludedRepoPatterns
  }
}
Variables
{"input": UpdateSignalConfigurationsInput}
Response
{
  "data": {
    "updateOwnSignalConfigurations": [
      {
        "name": "xyz789",
        "description": "xyz789",
        "isEnabled": true,
        "excludedRepoPatterns": ["xyz789"]
      }
    ]
  }
}

updatePackageRepoFilter

Description

Updates a package repo reference filter.

Response

Returns an EmptyResponse!

Arguments
Name Description
id - ID! The ID of the package repo reference filter to update.
behaviour - PackageMatchBehaviour!
kind - PackageRepoReferenceKind! The ecosystem of the package repo reference this matcher should apply to. Maps to the external service whos config would be updated when used in the set query.
filter - PackageVersionOrNameFilterInput!

Example

Query
mutation updatePackageRepoFilter(
  $id: ID!,
  $behaviour: PackageMatchBehaviour!,
  $kind: PackageRepoReferenceKind!,
  $filter: PackageVersionOrNameFilterInput!
) {
  updatePackageRepoFilter(
    id: $id,
    behaviour: $behaviour,
    kind: $kind,
    filter: $filter
  ) {
    alwaysNil
  }
}
Variables
{
  "id": 4,
  "behaviour": "BLOCK",
  "kind": "GOMODULES",
  "filter": PackageVersionOrNameFilterInput
}
Response
{
  "data": {
    "updatePackageRepoFilter": {
      "alwaysNil": "xyz789"
    }
  }
}

updatePassword

Description

Updates the current user's password. The oldPassword arg must match the user's current password.

Response

Returns an EmptyResponse

Arguments
Name Description
oldPassword - String!
newPassword - String!

Example

Query
mutation updatePassword(
  $oldPassword: String!,
  $newPassword: String!
) {
  updatePassword(
    oldPassword: $oldPassword,
    newPassword: $newPassword
  ) {
    alwaysNil
  }
}
Variables
{
  "oldPassword": "xyz789",
  "newPassword": "abc123"
}
Response
{
  "data": {
    "updatePassword": {
      "alwaysNil": "xyz789"
    }
  }
}

updatePieChartSearchInsight

Description

Update a pie chart backed by search insights.

Response

Returns an InsightViewPayload!

Arguments
Name Description
id - ID!
input - UpdatePieChartSearchInsightInput!

Example

Query
mutation updatePieChartSearchInsight(
  $id: ID!,
  $input: UpdatePieChartSearchInsightInput!
) {
  updatePieChartSearchInsight(
    id: $id,
    input: $input
  ) {
    view {
      ...InsightViewFragment
    }
  }
}
Variables
{
  "id": "4",
  "input": UpdatePieChartSearchInsightInput
}
Response
{
  "data": {
    "updatePieChartSearchInsight": {"view": InsightView}
  }
}

updateRepoKeyValuePair

Use updateRepoMetadata instead. This field is a deprecated and will be removed in a future release.
Description

Update a key-value pair associated with a repo.

Response

Returns an EmptyResponse!

Arguments
Name Description
repo - ID!
key - String!
value - String

Example

Query
mutation updateRepoKeyValuePair(
  $repo: ID!,
  $key: String!,
  $value: String
) {
  updateRepoKeyValuePair(
    repo: $repo,
    key: $key,
    value: $value
  ) {
    alwaysNil
  }
}
Variables
{
  "repo": "4",
  "key": "xyz789",
  "value": "xyz789"
}
Response
{
  "data": {
    "updateRepoKeyValuePair": {
      "alwaysNil": "abc123"
    }
  }
}

updateRepoMetadata

Description

Update metadata value for a given metadata key for associated with a repo.

Response

Returns an EmptyResponse!

Arguments
Name Description
repo - ID!
key - String!
value - String

Example

Query
mutation updateRepoMetadata(
  $repo: ID!,
  $key: String!,
  $value: String
) {
  updateRepoMetadata(
    repo: $repo,
    key: $key,
    value: $value
  ) {
    alwaysNil
  }
}
Variables
{
  "repo": 4,
  "key": "abc123",
  "value": "abc123"
}
Response
{
  "data": {
    "updateRepoMetadata": {
      "alwaysNil": "xyz789"
    }
  }
}

updateRepositoryIndexConfiguration

Description

Updates the indexing configuration associated with a repository.

Response

Returns an EmptyResponse

Arguments
Name Description
repository - ID!
configuration - String!

Example

Query
mutation updateRepositoryIndexConfiguration(
  $repository: ID!,
  $configuration: String!
) {
  updateRepositoryIndexConfiguration(
    repository: $repository,
    configuration: $configuration
  ) {
    alwaysNil
  }
}
Variables
{
  "repository": "4",
  "configuration": "xyz789"
}
Response
{
  "data": {
    "updateRepositoryIndexConfiguration": {
      "alwaysNil": "abc123"
    }
  }
}

updateSavedSearch

Description

Updates a saved search

Response

Returns a SavedSearch!

Arguments
Name Description
id - ID!
description - String!
query - String!
notifyOwner - Boolean!
notifySlack - Boolean!
orgID - ID
userID - ID

Example

Query
mutation updateSavedSearch(
  $id: ID!,
  $description: String!,
  $query: String!,
  $notifyOwner: Boolean!,
  $notifySlack: Boolean!,
  $orgID: ID,
  $userID: ID
) {
  updateSavedSearch(
    id: $id,
    description: $description,
    query: $query,
    notifyOwner: $notifyOwner,
    notifySlack: $notifySlack,
    orgID: $orgID,
    userID: $userID
  ) {
    id
    description
    query
    notify
    notifySlack
    namespace {
      ...NamespaceFragment
    }
    slackWebhookURL
  }
}
Variables
{
  "id": 4,
  "description": "abc123",
  "query": "xyz789",
  "notifyOwner": true,
  "notifySlack": false,
  "orgID": "4",
  "userID": 4
}
Response
{
  "data": {
    "updateSavedSearch": {
      "id": 4,
      "description": "abc123",
      "query": "xyz789",
      "notify": false,
      "notifySlack": true,
      "namespace": Namespace,
      "slackWebhookURL": "abc123"
    }
  }
}

updateSearchContext

Description

Update search context.

Response

Returns a SearchContext!

Arguments
Name Description
id - ID! Search context ID.
searchContext - SearchContextEditInput! Search context input.
repositories - [SearchContextRepositoryRevisionsInput!]! List of search context repository revisions.

Example

Query
mutation updateSearchContext(
  $id: ID!,
  $searchContext: SearchContextEditInput!,
  $repositories: [SearchContextRepositoryRevisionsInput!]!
) {
  updateSearchContext(
    id: $id,
    searchContext: $searchContext,
    repositories: $repositories
  ) {
    id
    name
    namespace {
      ...NamespaceFragment
    }
    description
    spec
    autoDefined
    query
    repositories {
      ...SearchContextRepositoryRevisionsFragment
    }
    public
    updatedAt
    viewerCanManage
    viewerHasAsDefault
    viewerHasStarred
  }
}
Variables
{
  "id": 4,
  "searchContext": SearchContextEditInput,
  "repositories": [SearchContextRepositoryRevisionsInput]
}
Response
{
  "data": {
    "updateSearchContext": {
      "id": "4",
      "name": "abc123",
      "namespace": Namespace,
      "description": "xyz789",
      "spec": "xyz789",
      "autoDefined": false,
      "query": "xyz789",
      "repositories": [SearchContextRepositoryRevisions],
      "public": true,
      "updatedAt": "2007-12-03T10:15:30Z",
      "viewerCanManage": false,
      "viewerHasAsDefault": true,
      "viewerHasStarred": true
    }
  }
}

updateSiteConfiguration

Description

Updates the site configuration. Returns whether or not a restart is required for the update to be applied.

Only site admins may perform this mutation.

Response

Returns a Boolean!

Arguments
Name Description
lastID - Int! The last ID of the site configuration that is known by the client, to prevent race conditions. An error will be returned if someone else has already written a new update.
input - String! A JSON object containing the entire site configuration. The previous site configuration will be replaced with this new value.

Example

Query
mutation updateSiteConfiguration(
  $lastID: Int!,
  $input: String!
) {
  updateSiteConfiguration(
    lastID: $lastID,
    input: $input
  )
}
Variables
{"lastID": 987, "input": "xyz789"}
Response
{"data": {"updateSiteConfiguration": false}}

updateTeam

Description

Update an existing team. ID or Name must be specified, but not both.

To unset the display name, pass an empty string. Null will make it ignore updates.

Either parentTeam XOR parentTeamName XOR makeRoot can be specified to make the team a child team of the given parent or conversely to make a team a root team (with no parent team). The user has to be a team-member of both the child and parent team for that, and neither can be read-only. Site-admin can modify all teams without constraints.

Response

Returns a Team!

Arguments
Name Description
id - ID
name - String
displayName - String
parentTeam - ID
parentTeamName - String
makeRoot - Boolean

Example

Query
mutation updateTeam(
  $id: ID,
  $name: String,
  $displayName: String,
  $parentTeam: ID,
  $parentTeamName: String,
  $makeRoot: Boolean
) {
  updateTeam(
    id: $id,
    name: $name,
    displayName: $displayName,
    parentTeam: $parentTeam,
    parentTeamName: $parentTeamName,
    makeRoot: $makeRoot
  ) {
    id
    name
    url
    avatarURL
    displayName
    readonly
    members {
      ...TeamMemberConnectionFragment
    }
    parentTeam {
      ...TeamFragment
    }
    childTeams {
      ...TeamConnectionFragment
    }
    viewerCanAdminister
    creator {
      ...UserFragment
    }
    external
  }
}
Variables
{
  "id": 4,
  "name": "abc123",
  "displayName": "abc123",
  "parentTeam": 4,
  "parentTeamName": "abc123",
  "makeRoot": false
}
Response
{
  "data": {
    "updateTeam": {
      "id": 4,
      "name": "xyz789",
      "url": "xyz789",
      "avatarURL": "xyz789",
      "displayName": "xyz789",
      "readonly": true,
      "members": TeamMemberConnection,
      "parentTeam": Team,
      "childTeams": TeamConnection,
      "viewerCanAdminister": false,
      "creator": User,
      "external": false
    }
  }
}

updateUser

Description

Updates the user profile information for the user with the given ID.

Only the user and site admins may perform this mutation.

Response

Returns a User!

Arguments
Name Description
user - ID!
username - String
displayName - String
avatarURL - String

Example

Query
mutation updateUser(
  $user: ID!,
  $username: String,
  $displayName: String,
  $avatarURL: String
) {
  updateUser(
    user: $user,
    username: $username,
    displayName: $displayName,
    avatarURL: $avatarURL
  ) {
    executorSecrets {
      ...ExecutorSecretConnectionFragment
    }
    id
    username
    email
    displayName
    avatarURL
    url
    settingsURL
    createdAt
    updatedAt
    siteAdmin
    builtinAuth
    latestSettings {
      ...SettingsFragment
    }
    settingsCascade {
      ...SettingsCascadeFragment
    }
    configurationCascade {
      ...ConfigurationCascadeFragment
    }
    organizations {
      ...OrgConnectionFragment
    }
    organizationMemberships {
      ...OrganizationMembershipConnectionFragment
    }
    tosAccepted
    usageStatistics {
      ...UserUsageStatisticsFragment
    }
    eventLogs {
      ...EventLogsConnectionFragment
    }
    emails {
      ...UserEmailFragment
    }
    hasVerifiedEmail
    completedPostSignup
    primaryEmail {
      ...UserEmailFragment
    }
    accessTokens {
      ...AccessTokenConnectionFragment
    }
    externalAccounts {
      ...ExternalAccountConnectionFragment
    }
    session {
      ...SessionFragment
    }
    viewerCanAdminister
    viewerCanChangeUsername
    surveyResponses {
      ...SurveyResponseFragment
    }
    databaseID
    namespaceName
    scimControlled
    roles {
      ...RoleConnectionFragment
    }
    permissions {
      ...PermissionConnectionFragment
    }
    completionsQuotaOverride
    codeCompletionsQuotaOverride
    codySubscription {
      ...CodySubscriptionFragment
    }
    codyProEnabled
    codyCurrentPeriodChatUsage
    codyCurrentPeriodCodeUsage
    codyCurrentPeriodChatLimit
    codyCurrentPeriodCodeLimit
    teams {
      ...TeamConnectionFragment
    }
    batchChanges {
      ...BatchChangeConnectionFragment
    }
    batchChangesCodeHosts {
      ...BatchChangesCodeHostConnectionFragment
    }
  }
}
Variables
{
  "user": "4",
  "username": "abc123",
  "displayName": "xyz789",
  "avatarURL": "abc123"
}
Response
{
  "data": {
    "updateUser": {
      "executorSecrets": ExecutorSecretConnection,
      "id": 4,
      "username": "xyz789",
      "email": "xyz789",
      "displayName": "abc123",
      "avatarURL": "xyz789",
      "url": "abc123",
      "settingsURL": "xyz789",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "siteAdmin": false,
      "builtinAuth": false,
      "latestSettings": Settings,
      "settingsCascade": SettingsCascade,
      "configurationCascade": ConfigurationCascade,
      "organizations": OrgConnection,
      "organizationMemberships": OrganizationMembershipConnection,
      "tosAccepted": false,
      "usageStatistics": UserUsageStatistics,
      "eventLogs": EventLogsConnection,
      "emails": [UserEmail],
      "hasVerifiedEmail": true,
      "completedPostSignup": false,
      "primaryEmail": UserEmail,
      "accessTokens": AccessTokenConnection,
      "externalAccounts": ExternalAccountConnection,
      "session": Session,
      "viewerCanAdminister": false,
      "viewerCanChangeUsername": false,
      "surveyResponses": [SurveyResponse],
      "databaseID": 123,
      "namespaceName": "xyz789",
      "scimControlled": false,
      "roles": RoleConnection,
      "permissions": PermissionConnection,
      "completionsQuotaOverride": 123,
      "codeCompletionsQuotaOverride": 987,
      "codySubscription": CodySubscription,
      "codyProEnabled": true,
      "codyCurrentPeriodChatUsage": 123,
      "codyCurrentPeriodCodeUsage": 987,
      "codyCurrentPeriodChatLimit": 123,
      "codyCurrentPeriodCodeLimit": 987,
      "teams": TeamConnection,
      "batchChanges": BatchChangeConnection,
      "batchChangesCodeHosts": BatchChangesCodeHostConnection
    }
  }
}

updateWebhook

Description

Updates a webhook with given ID. Null values aren't updated.

Response

Returns a Webhook!

Arguments
Name Description
id - ID!
name - String
codeHostKind - String
codeHostURN - String
secret - String

Example

Query
mutation updateWebhook(
  $id: ID!,
  $name: String,
  $codeHostKind: String,
  $codeHostURN: String,
  $secret: String
) {
  updateWebhook(
    id: $id,
    name: $name,
    codeHostKind: $codeHostKind,
    codeHostURN: $codeHostURN,
    secret: $secret
  ) {
    id
    uuid
    url
    name
    codeHostKind
    codeHostURN
    secret
    updatedAt
    updatedBy {
      ...UserFragment
    }
    createdAt
    createdBy {
      ...UserFragment
    }
    webhookLogs {
      ...WebhookLogConnectionFragment
    }
  }
}
Variables
{
  "id": "4",
  "name": "xyz789",
  "codeHostKind": "xyz789",
  "codeHostURN": "xyz789",
  "secret": "xyz789"
}
Response
{
  "data": {
    "updateWebhook": {
      "id": "4",
      "uuid": "abc123",
      "url": "abc123",
      "name": "abc123",
      "codeHostKind": "AWSCODECOMMIT",
      "codeHostURN": "xyz789",
      "secret": "abc123",
      "updatedAt": "2007-12-03T10:15:30Z",
      "updatedBy": User,
      "createdAt": "2007-12-03T10:15:30Z",
      "createdBy": User,
      "webhookLogs": WebhookLogConnection
    }
  }
}

upsertBatchSpecInput

Description

Creates or updates a batch spec based on the given namespace and name, then triggers a job to evaluate the workspaces.

This is essentially a wrapper for createBatchSpecFromRaw and replaceBatchSpecInput to facilitate src-cli, and should not be used otherwise.

Response

Returns a BatchSpec!

Arguments
Name Description
batchSpec - String! The raw batch spec as YAML (or the equivalent JSON). See https://sourcegraph.com/github.com/sourcegraph/sourcegraph/-/blob/schema/batch_spec.schema.json for the JSON Schema that describes the structure of this input.
allowIgnored - Boolean If true, repos with a .batchignore file will still be included. Default = false
allowUnsupported - Boolean If true, repos on unsupported codehosts will be included. Resulting changesets in these repos cannot be published. Default = false
execute - Boolean

Right away set the execute flag.

TODO: Not implemented yet. Default = false

noCache - Boolean Don't use cache entries. Default = false
namespace - ID! The namespace (either a user or organization). A batch spec can only be applied to (or used to create) batch changes in this namespace.

Example

Query
mutation upsertBatchSpecInput(
  $batchSpec: String!,
  $allowIgnored: Boolean,
  $allowUnsupported: Boolean,
  $execute: Boolean,
  $noCache: Boolean,
  $namespace: ID!
) {
  upsertBatchSpecInput(
    batchSpec: $batchSpec,
    allowIgnored: $allowIgnored,
    allowUnsupported: $allowUnsupported,
    execute: $execute,
    noCache: $noCache,
    namespace: $namespace
  ) {
    id
    autoApplyEnabled
    state
    originalInput
    parsedInput
    description {
      ...BatchChangeDescriptionFragment
    }
    applyPreview {
      ...ChangesetApplyPreviewConnectionFragment
    }
    changesetSpecs {
      ...ChangesetSpecConnectionFragment
    }
    creator {
      ...UserFragment
    }
    createdAt
    startedAt
    finishedAt
    namespace {
      ...NamespaceFragment
    }
    expiresAt
    applyURL
    viewerCanAdminister
    diffStat {
      ...DiffStatFragment
    }
    appliesToBatchChange {
      ...BatchChangeFragment
    }
    supersedingBatchSpec {
      ...BatchSpecFragment
    }
    viewerBatchChangesCodeHosts {
      ...BatchChangesCodeHostConnectionFragment
    }
    workspaceResolution {
      ...BatchSpecWorkspaceResolutionFragment
    }
    importingChangesets {
      ...ChangesetSpecConnectionFragment
    }
    failureMessage
    allowIgnored
    allowUnsupported
    noCache
    viewerCanRetry
    source
    files {
      ...BatchSpecWorkspaceFileConnectionFragment
    }
  }
}
Variables
{
  "batchSpec": "abc123",
  "allowIgnored": false,
  "allowUnsupported": false,
  "execute": false,
  "noCache": false,
  "namespace": 4
}
Response
{
  "data": {
    "upsertBatchSpecInput": {
      "id": 4,
      "autoApplyEnabled": true,
      "state": "PENDING",
      "originalInput": "abc123",
      "parsedInput": JSONValue,
      "description": BatchChangeDescription,
      "applyPreview": ChangesetApplyPreviewConnection,
      "changesetSpecs": ChangesetSpecConnection,
      "creator": User,
      "createdAt": "2007-12-03T10:15:30Z",
      "startedAt": "2007-12-03T10:15:30Z",
      "finishedAt": "2007-12-03T10:15:30Z",
      "namespace": Namespace,
      "expiresAt": "2007-12-03T10:15:30Z",
      "applyURL": "xyz789",
      "viewerCanAdminister": false,
      "diffStat": DiffStat,
      "appliesToBatchChange": BatchChange,
      "supersedingBatchSpec": BatchSpec,
      "viewerBatchChangesCodeHosts": BatchChangesCodeHostConnection,
      "workspaceResolution": BatchSpecWorkspaceResolution,
      "importingChangesets": ChangesetSpecConnection,
      "failureMessage": "abc123",
      "allowIgnored": true,
      "allowUnsupported": true,
      "noCache": false,
      "viewerCanRetry": true,
      "source": "LOCAL",
      "files": BatchSpecWorkspaceFileConnection
    }
  }
}

upsertEmptyBatchChange

Description

Checks if a batch change with the specified name exists, if it doesn't, it creates a batch change with an empty batch spec otherwise returns the existing batch change, this is useful for drafting server-side batch changes with the src-cli tool. The user creating the batch change must have permission to create it in the namespace provided. Use createBatchSpecFromRaw and replaceBatchSpecInput to update the input batch spec after creating.

Response

Returns a BatchChange!

Arguments
Name Description
namespace - ID! The namespace (either a user or organization) that this batch change should belong to.
name - String! The (unique) name to identify the batch change by in its namespace.

Example

Query
mutation upsertEmptyBatchChange(
  $namespace: ID!,
  $name: String!
) {
  upsertEmptyBatchChange(
    namespace: $namespace,
    name: $name
  ) {
    id
    namespace {
      ...NamespaceFragment
    }
    name
    description
    state
    creator {
      ...UserFragment
    }
    lastApplier {
      ...UserFragment
    }
    viewerCanAdminister
    url
    createdAt
    updatedAt
    lastAppliedAt
    closedAt
    changesetsStats {
      ...ChangesetsStatsFragment
    }
    changesets {
      ...ChangesetConnectionFragment
    }
    changesetCountsOverTime {
      ...ChangesetCountsFragment
    }
    diffStat {
      ...DiffStatFragment
    }
    currentSpec {
      ...BatchSpecFragment
    }
    bulkOperations {
      ...BulkOperationConnectionFragment
    }
    batchSpecs {
      ...BatchSpecConnectionFragment
    }
  }
}
Variables
{
  "namespace": "4",
  "name": "xyz789"
}
Response
{
  "data": {
    "upsertEmptyBatchChange": {
      "id": "4",
      "namespace": Namespace,
      "name": "abc123",
      "description": "abc123",
      "state": "OPEN",
      "creator": User,
      "lastApplier": User,
      "viewerCanAdminister": false,
      "url": "xyz789",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z",
      "lastAppliedAt": "2007-12-03T10:15:30Z",
      "closedAt": "2007-12-03T10:15:30Z",
      "changesetsStats": ChangesetsStats,
      "changesets": ChangesetConnection,
      "changesetCountsOverTime": [ChangesetCounts],
      "diffStat": DiffStat,
      "currentSpec": BatchSpec,
      "bulkOperations": BulkOperationConnection,
      "batchSpecs": BatchSpecConnection
    }
  }
}

Types

AccessRequest

Description

Access request

Fields
Field Name Description
id - ID! The unique identifier of the secret.
name - String! Name of a person requested access
email - String! Email of a person requested access
createdAt - DateTime! The date and time when request access was created
additionalInfo - String Additional information submitted by person requested access
status - AccessRequestStatus! Access request status
Example
{
  "id": "4",
  "name": "xyz789",
  "email": "xyz789",
  "createdAt": "2007-12-03T10:15:30Z",
  "additionalInfo": "abc123",
  "status": "PENDING"
}

AccessRequestConnection

Description

A list of access requests

Fields
Field Name Description
totalCount - Int! Total count of access requests
nodes - [AccessRequest!]! A list of access requests
pageInfo - BidirectionalPageInfo! Pagination information.
Example
{
  "totalCount": 123,
  "nodes": [AccessRequest],
  "pageInfo": BidirectionalPageInfo
}

AccessRequestStatus

Description

Access request status enum

Values
Enum Value Description

PENDING

Access request is submitted and waiting for actions

APPROVED

Access request was approved

REJECTED

Access request was rejected

CANCELED

Access request was canceled
Example
"PENDING"

AccessToken

Description

An access token that grants to the holder the privileges of the user who created it.

Fields
Field Name Description
id - ID! The unique ID for the access token.
subject - User! The user whose privileges the access token grants.
scopes - [String!]! The scopes that define the allowed set of operations that can be performed using this access token.
note - String! A user-supplied descriptive note for the access token.
creator - User! The user who created the access token. This is either the subject user (if the access token was created by the same user) or a site admin (who can create access tokens for any user).
createdAt - DateTime! The date when the access token was created.
lastUsedAt - DateTime The date when the access token was last used to authenticate a request.
expiresAt - DateTime If non-null, the token may no longer be used after this date.
Example
{
  "id": "4",
  "subject": User,
  "scopes": ["abc123"],
  "note": "abc123",
  "creator": User,
  "createdAt": "2007-12-03T10:15:30Z",
  "lastUsedAt": "2007-12-03T10:15:30Z",
  "expiresAt": "2007-12-03T10:15:30Z"
}

AccessTokenConnection

Description

A list of access tokens.

Fields
Field Name Description
nodes - [AccessToken!]! A list of access tokens.
totalCount - Int! The total count of access tokens in the connection. This total count may be larger than the number of nodes in this object when the result is paginated.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [AccessToken],
  "totalCount": 987,
  "pageInfo": PageInfo
}

AddExternalServiceInput

Description

A new external service.

Fields
Input Field Description
kind - ExternalServiceKind! The kind of the external service.
displayName - String! The display name of the external service.
config - String! The JSON configuration of the external service.
namespace - ID The namespace this external service belongs to. This can be used both for a user and an organization.
Example
{
  "kind": "AWSCODECOMMIT",
  "displayName": "abc123",
  "config": "abc123",
  "namespace": 4
}

AddInsightViewToDashboardInput

Description

Input object for adding insight view to dashboard.

Fields
Input Field Description
insightViewId - ID! ID of the insight view to attach to the dashboard
dashboardId - ID! ID of the dashboard.
Example
{"insightViewId": 4, "dashboardId": "4"}

AggregationGroup

Description

Information regarding the availablity of a SearchAggregationMode

Fields
Field Name Description
label - String! A label associated with the Aggregation for example a Repo name or Author name
count - Int! The number of hits for this search
query - String A modified search query that would filter the orginal query to just the selected group
Example
{
  "label": "xyz789",
  "count": 123,
  "query": "abc123"
}

AggregationModeAvailability

Description

Information regarding the availablity of a SearchAggregationMode

Fields
Field Name Description
mode - SearchAggregationMode! The SearchAggregationMode
available - Boolean! Boolean indicating if the mode is available
reasonUnavailable - String If the mode is unavailable the reason why
Example
{
  "mode": "REPO",
  "available": false,
  "reasonUnavailable": "abc123"
}

Alert

Description

An alert message shown to the viewer.

Fields
Field Name Description
type - AlertType! The type of this alert.
message - String! The message body of this alert. Markdown is supported.
isDismissibleWithKey - String If set, this alert is dismissible. After being dismissed, no other alerts with the same isDismissibleWithKey value will be shown. If null, this alert is not dismissible.
Example
{
  "type": "INFO",
  "message": "abc123",
  "isDismissibleWithKey": "abc123"
}

AlertType

Description

The possible types of alerts (Alert.type values).

Values
Enum Value Description

INFO

WARNING

ERROR

Example
"INFO"

Analytics

Description

Analytics describes a new site statistics.

Fields
Field Name Description
search - AnalyticsSearchResult! Search statistics.
Arguments
dateRange - AnalyticsDateRange
grouping - AnalyticsGrouping
notebooks - AnalyticsNotebooksResults! Notebooks statistics.
Arguments
dateRange - AnalyticsDateRange
grouping - AnalyticsGrouping
users - AnalyticsUsersResult! Users statistics.
Arguments
dateRange - AnalyticsDateRange
grouping - AnalyticsGrouping
codeIntel - AnalyticsCodeIntelResult! Code-intelligence statistics.
Arguments
dateRange - AnalyticsDateRange
grouping - AnalyticsGrouping
codeIntelByLanguage - [AnalyticsCodeIntelByLanguageResult!]! Code-intelligence statistics grouped by language and precision.
Arguments
dateRange - AnalyticsDateRange
codeIntelTopRepositories - [AnalyticsCodeIntelRepositoryResult!]! Top repositories by code-intelligence events.
Arguments
dateRange - AnalyticsDateRange
repos - AnalyticsReposSummartResult! Repositories summary statistics.
batchChanges - AnalyticsBatchChangesResult! Batch changes statistics
Arguments
dateRange - AnalyticsDateRange
grouping - AnalyticsGrouping
extensions - AnalyticsExtensionsResult! Extensions statistics
Arguments
dateRange - AnalyticsDateRange
grouping - AnalyticsGrouping
codeInsights - AnalyticsCodesInsightsResult! Code insights statistics
Arguments
dateRange - AnalyticsDateRange
grouping - AnalyticsGrouping
Example
{
  "search": AnalyticsSearchResult,
  "notebooks": AnalyticsNotebooksResults,
  "users": AnalyticsUsersResult,
  "codeIntel": AnalyticsCodeIntelResult,
  "codeIntelByLanguage": [
    AnalyticsCodeIntelByLanguageResult
  ],
  "codeIntelTopRepositories": [
    AnalyticsCodeIntelRepositoryResult
  ],
  "repos": AnalyticsReposSummartResult,
  "batchChanges": AnalyticsBatchChangesResult,
  "extensions": AnalyticsExtensionsResult,
  "codeInsights": AnalyticsCodesInsightsResult
}

AnalyticsBatchChangesResult

Description

Batch changes analytics.

Fields
Field Name Description
changesetsCreated - AnalyticsStatItem! Changesets created
changesetsMerged - AnalyticsStatItem! Changesets merged
Example
{
  "changesetsCreated": AnalyticsStatItem,
  "changesetsMerged": AnalyticsStatItem
}

AnalyticsCodeIntelByLanguageResult

Description

CodeIntelByLanguage analytics.

Fields
Field Name Description
language - String! Language
precision - String! Precision
count - Float! Count
Example
{
  "language": "xyz789",
  "precision": "xyz789",
  "count": 123.45
}

AnalyticsCodeIntelRepositoryResult

Description

CodeIntelTopRepositories analytics.

Fields
Field Name Description
name - String! Repository name
language - String! Language
kind - String! Event kind
precision - String! Event precision (either "search-based" or "precise")
events - Float! Event count
hasPrecise - Boolean! Has precise
Example
{
  "name": "xyz789",
  "language": "abc123",
  "kind": "abc123",
  "precision": "xyz789",
  "events": 123.45,
  "hasPrecise": false
}

AnalyticsCodeIntelResult

Description

CodeIntel' analytics.

Fields
Field Name Description
referenceClicks - AnalyticsStatItem! "GoToRef" click
definitionClicks - AnalyticsStatItem! "GoToDef" click
inAppEvents - AnalyticsStatItem! Code Intel events made from web
codeHostEvents - AnalyticsStatItem! Code Intel events made from code host
searchBasedEvents - AnalyticsStatItem! Search based events
preciseEvents - AnalyticsStatItem! Precise events
crossRepoEvents - AnalyticsStatItem! Cross-repo events
Example
{
  "referenceClicks": AnalyticsStatItem,
  "definitionClicks": AnalyticsStatItem,
  "inAppEvents": AnalyticsStatItem,
  "codeHostEvents": AnalyticsStatItem,
  "searchBasedEvents": AnalyticsStatItem,
  "preciseEvents": AnalyticsStatItem,
  "crossRepoEvents": AnalyticsStatItem
}

AnalyticsCodesInsightsResult

Description

Code insights analytics.

Fields
Field Name Description
insightHovers - AnalyticsStatItem! Insights hovers statistics.
insightDataPointClicks - AnalyticsStatItem! Insights data point clicks statistics.
Example
{
  "insightHovers": AnalyticsStatItem,
  "insightDataPointClicks": AnalyticsStatItem
}

AnalyticsDateRange

Description

A pre-defined periods to get site analytics.

Values
Enum Value Description

LAST_THREE_MONTHS

Last 3 months date range.

LAST_MONTH

Last month date range.

LAST_WEEK

Last week date range.

CUSTOM

Custom date range.
Example
"LAST_THREE_MONTHS"

AnalyticsExtensionsResult

Description

Extentions analytics.

Fields
Field Name Description
jetbrains - AnalyticsStatItem! JetBrains IDE plugin search events.
vscode - AnalyticsStatItem! VSCode IDE extension search events.
browser - AnalyticsStatItem! Browser (chrome, firefox, safari) extensions code navigation events. This includes events like "Go to Def", "Find ref" and "Find implementation"
Example
{
  "jetbrains": AnalyticsStatItem,
  "vscode": AnalyticsStatItem,
  "browser": AnalyticsStatItem
}

AnalyticsGrouping

Description

Group site analytics by period.

Values
Enum Value Description

DAILY

Group data by day.

WEEKLY

Group data by week.
Example
"DAILY"

AnalyticsMonthlyActiveUsers

Description

Monthly active users

Fields
Field Name Description
date - String! year-month for which the total active users are calculated
count - Float! total count of active users
Example
{"date": "abc123", "count": 987.65}

AnalyticsNotebooksResults

Description

Notebook analytics.

Fields
Field Name Description
creations - AnalyticsStatItem! Notebooks creation analytics.
views - AnalyticsStatItem! Notebooks views analytics.
blockRuns - AnalyticsStatItem! Notebooks block run analytics.
Example
{
  "creations": AnalyticsStatItem,
  "views": AnalyticsStatItem,
  "blockRuns": AnalyticsStatItem
}

AnalyticsReposSummartResult

Description

Repositories summary.

Fields
Field Name Description
count - Float! Total number of repositories.
preciseCodeIntelCount - Float! Total number of repositories with precise code-intel.
Example
{"count": 123.45, "preciseCodeIntelCount": 987.65}

AnalyticsSearchResult

Description

Search analytics.

Fields
Field Name Description
searches - AnalyticsStatItem! Searches analytics
resultClicks - AnalyticsStatItem! Search result click analytics
fileViews - AnalyticsStatItem! File view analytics
fileOpens - AnalyticsStatItem! File open analytics
codeCopied - AnalyticsStatItem! Code copied from search results analytics
Example
{
  "searches": AnalyticsStatItem,
  "resultClicks": AnalyticsStatItem,
  "fileViews": AnalyticsStatItem,
  "fileOpens": AnalyticsStatItem,
  "codeCopied": AnalyticsStatItem
}

AnalyticsStatItem

Description

Analytics result item.

Fields
Field Name Description
summary - AnalyticsStatItemSummary! Analytics summary.
nodes - [AnalyticsStatItemNode!]! Array of analytics by period.
Example
{
  "summary": AnalyticsStatItemSummary,
  "nodes": [AnalyticsStatItemNode]
}

AnalyticsStatItemNode

Description

Analytics for certain date.

Fields
Field Name Description
date - String! A date in ISO format
count - Float! Total number of events.
uniqueUsers - Float! Unique number of users who triggered event. This counts deleted users as well as anonymous users.
registeredUsers - Float! Unique number of currently registered users who triggered event.
Example
{
  "date": "xyz789",
  "count": 123.45,
  "uniqueUsers": 987.65,
  "registeredUsers": 987.65
}

AnalyticsStatItemSummary

Description

Analytics summary.

Fields
Field Name Description
totalCount - Float! Total number of events.
totalUniqueUsers - Float! Total unique number of users who triggered event. This counts deleted users as well as anonymous users.
totalRegisteredUsers - Float! Total unique number of currently registered users who triggered event.
Example
{
  "totalCount": 123.45,
  "totalUniqueUsers": 987.65,
  "totalRegisteredUsers": 987.65
}

AnalyticsUsersFrequencyItem

Description

Users frequency by days used.

Fields
Field Name Description
daysUsed - Float! Number of days used
frequency - Float! Number of users.
percentage - Float! Percentage of users from total frequencies.
Example
{"daysUsed": 123.45, "frequency": 123.45, "percentage": 123.45}

AnalyticsUsersResult

Description

Users' analytics.

Fields
Field Name Description
activity - AnalyticsStatItem! Users' activity analytics.
frequencies - [AnalyticsUsersFrequencyItem!]! Frequency of usage by day.
monthlyActiveUsers - [AnalyticsMonthlyActiveUsers!]! Monthly active users for last 3 months.
Example
{
  "activity": AnalyticsStatItem,
  "frequencies": [AnalyticsUsersFrequencyItem],
  "monthlyActiveUsers": [AnalyticsMonthlyActiveUsers]
}

AssignOwnerOrTeamInput

Description

AssignOwnerOrTeamInput represents the input for assigning or deleting an owner team or person.

Fields
Input Field Description
assignedOwnerID - ID! ID of an assigned owner or team.
repoID - ID! ID of a repo, which (or which directory/file) is assigned for ownership.
absolutePath - String! Path of the file/directory or a root path of the repo, which is assigned for ownership.
Example
{
  "assignedOwnerID": "4",
  "repoID": "4",
  "absolutePath": "abc123"
}

AssignedOwner

Description

Manually assigned owner.

Fields
Field Name Description
title - String! Descriptive title to display in the UI for the determination.
description - String! More detailed description to display in the UI for the determination.
isDirectMatch - Boolean! Whether or not this rule matches a path directly, or is inherited from a parent path.
Example
{
  "title": "abc123",
  "description": "abc123",
  "isDirectMatch": true
}

AttributionSnippetThreshold

Description

AttributionSnippetThreshold describes whether search snippet was considered large enough to run the search, and what are the thresholds.

Fields
Field Name Description
searchPerformed - Boolean! Whether or not search for the snippet parameter was run.
linesLowerBound - Int! Lower bound of lines that Cody considers for attribution search (if any).
Example
{"searchPerformed": true, "linesLowerBound": 123}

AuditLogColumnChange

Description

Represents a state transition of a single column.

Fields
Field Name Description
column - String! The column that is changing.
old - String The previous value of the column.
new - String The new value of the column
Example
{
  "column": "abc123",
  "old": "xyz789",
  "new": "abc123"
}

AuditLogOperation

Description

Denotes the type of operation of a given log entry.

Values
Enum Value Description

CREATE

Denotes this log entry represents an INSERT query.

MODIFY

Denotes this log entry represents an UPDATE query.
Example
"CREATE"

AuthProvider

Description

A provider of user authentication, such as an external single-sign-on service (e.g., using OpenID Connect or SAML). The provider information in this type is visible to all viewers and does not contain any secret values.

Fields
Field Name Description
serviceType - String! The type of the auth provider.
serviceID - String! An identifier for the service that the auth provider represents.
clientID - String! An identifier for the client of the service that the auth provider represents.
displayName - String! The human-readable name of the provider.
isBuiltin - Boolean! Whether this auth provider is the builtin username-password auth provider.
authenticationURL - String A URL that, when visited, initiates the authentication process for this auth provider.
Example
{
  "serviceType": "abc123",
  "serviceID": "xyz789",
  "clientID": "xyz789",
  "displayName": "abc123",
  "isBuiltin": false,
  "authenticationURL": "xyz789"
}

AuthProviderConnection

Description

A list of authentication providers.

Fields
Field Name Description
nodes - [AuthProvider!]! A list of authentication providers.
totalCount - Int! The total count of authentication providers in the connection. This total count may be larger than the number of nodes in this object when the result is paginated.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [AuthProvider],
  "totalCount": 123,
  "pageInfo": PageInfo
}

AutoIndexJobDescription

Description

A description of an auto-indexing job inferred by the instance.

Fields
Field Name Description
root - String! The project root.
indexer - CodeIntelIndexer The target indexer.
comparisonKey - String!

A hash of the root and indexer values.

This value can be used to quickly compare whether or not explicit configuration and inferred configuration refer to the same "project" in a given repository. See RootWithKey.comparisonKey.

steps - IndexSteps! The particular steps inferred for indexing.
Example
{
  "root": "abc123",
  "indexer": CodeIntelIndexer,
  "comparisonKey": "xyz789",
  "steps": IndexSteps
}

AutocompleteMemberSearchItem

Description

Result user returned by invite members autocomplete search.

Fields
Field Name Description
id - ID! The unique ID for the user.
username - String! The user's username.
displayName - String The display name chosen by the user.
avatarURL - String The URL of the user's avatar image.
inOrg - Boolean If the user belongs to current Organization.
Example
{
  "id": "4",
  "username": "abc123",
  "displayName": "abc123",
  "avatarURL": "xyz789",
  "inOrg": false
}

BackfillQueueOrderBy

Description

BackfillQueueOrderBy enumerates the ways a backfill queue list can be ordered.

Values
Enum Value Description

STATE

QUEUE_POSITION

Example
"STATE"

BackfillStatus

Description

The status of an insights backfill

Fields
Field Name Description
state - InsightQueueItemState! The current backfill queue state
queuePosition - Int If the item is queued the position in the queue of
errors - [String!] A list of errors that have occurred during backfilling
cost - Int The estimated cost of the backfill process
percentComplete - Int The percent complete of the backfill
createdAt - DateTime The date/time when the backfill was created
startedAt - DateTime The date/time when the backfill started processing
completedAt - DateTime The date/time when the backfill completed processing
runtime - String The actual runtime duration spent processing the backfill
Example
{
  "state": "NEW",
  "queuePosition": 987,
  "errors": ["abc123"],
  "cost": 123,
  "percentComplete": 987,
  "createdAt": "2007-12-03T10:15:30Z",
  "startedAt": "2007-12-03T10:15:30Z",
  "completedAt": "2007-12-03T10:15:30Z",
  "runtime": "xyz789"
}

BackgroundJob

Description

A single background job.

Fields
Field Name Description
id - ID! The background job ID.
name - String! The name of the job.
routines - [BackgroundRoutine!]! The routines that run inside this job.
Example
{
  "id": "4",
  "name": "xyz789",
  "routines": [BackgroundRoutine]
}

BackgroundJobConnection

Description

A list of background jobs that are currently known in the system

Fields
Field Name Description
nodes - [BackgroundJob!]! A list of outbound requests.
totalCount - Int! The total number of outbound request log items in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [BackgroundJob],
  "totalCount": 123,
  "pageInfo": PageInfo
}

BackgroundRoutine

Description

A routine that runs inside a background job.

Fields
Field Name Description
name - String! The name of the routine.
type - BackgroundRoutineType! Tells whether this is a periodic goroutine, a DB worker, or something else
description - String! Explains what the routine does.
intervalMs - Int The interval at which the routine runs, if it's periodic.
instances - [BackgroundRoutineInstance!]! The instances of this routine that are running or ran recently. An instance means one routine on one host.
recentRuns - [BackgroundRoutineRecentRun!]! The recent runs of this routine.
stats - BackgroundRoutineStats! Some stats of the runs of this routine in the past few days.
Example
{
  "name": "xyz789",
  "type": "PERIODIC",
  "description": "xyz789",
  "intervalMs": 123,
  "instances": [BackgroundRoutineInstance],
  "recentRuns": [BackgroundRoutineRecentRun],
  "stats": BackgroundRoutineStats
}

BackgroundRoutineInstance

Description

One instance of the background routine, running on a host.

Fields
Field Name Description
hostName - String! The ID of the instance.
lastStartedAt - DateTime The time the instance was last started. (If it's unknown, this will be null.)
lastStoppedAt - DateTime The time the instance was last stopped. (If it's unknown, this will be null.)
Example
{
  "hostName": "xyz789",
  "lastStartedAt": "2007-12-03T10:15:30Z",
  "lastStoppedAt": "2007-12-03T10:15:30Z"
}

BackgroundRoutineRecentRun

Description

A single run of the routine. A run is not the start/stop event but the actual execution of the routine handler.

Fields
Field Name Description
at - DateTime! The time the run started.
hostName - String! The name of the host that ran the routine.
durationMs - Int! The duration of the run.
errorMessage - String The error message, if any.
Example
{
  "at": "2007-12-03T10:15:30Z",
  "hostName": "xyz789",
  "durationMs": 123,
  "errorMessage": "xyz789"
}

BackgroundRoutineStats

Description

Holds statistics about a background routine.

Fields
Field Name Description
since - DateTime The start of the earliest day for which we have any runs registered.
runCount - Int! The number of times the routine ran in the period.
errorCount - Int! The number of times the routine run ended with an error.
minDurationMs - Int! The minimum duration of a run, in milliseconds.
avgDurationMs - Int! The average duration of a run, in milliseconds.
maxDurationMs - Int! The maximum duration of a run, in milliseconds.
Example
{
  "since": "2007-12-03T10:15:30Z",
  "runCount": 123,
  "errorCount": 123,
  "minDurationMs": 987,
  "avgDurationMs": 987,
  "maxDurationMs": 123
}

BackgroundRoutineType

Description

Enum of the possible background routine types

Values
Enum Value Description

PERIODIC

Periodic routine

PERIODIC_WITH_METRICS

Periodic routine with metrics set up

DB_BACKED

DB-backed worker

CUSTOM

Custom routine
Example
"PERIODIC"

BatchChange

Description

A batch change is a set of related changes to apply to code across one or more repositories.

Fields
Field Name Description
id - ID! The unique ID for the batch change.
namespace - Namespace! The namespace where this batch change is defined.
name - String! The name of the batch change.
description - String The description (as Markdown).
state - BatchChangeState! The state of the batch change.
creator - User The user who created the batch change, or null if the user was deleted.
lastApplier - User The user who last updated the batch change by applying a spec to this batch change. If the batch change hasn't been updated, the lastApplier is the initialApplier, or null if the user was deleted.
viewerCanAdminister - Boolean! Whether the current user can edit or delete this batch change.
url - String! The URL to this batch change.
createdAt - DateTime! The date and time when the batch change was created.
updatedAt - DateTime! The date and time when the batch change was updated. That can be by applying a spec, or by an internal process. For reading the time the batch change spec was changed last, see lastAppliedAt.
lastAppliedAt - DateTime The date and time when the batch change was last updated with a new spec. Null, if a batch spec has never been applied yet.
closedAt - DateTime The date and time when the batch change was closed. If set, applying a spec for this batch change will fail with an error.
changesetsStats - ChangesetsStats! Stats on all the changesets that are tracked in this batch change.
changesets - ChangesetConnection! The changesets in this batch change that already exist on the code host.
Arguments
first - Int
after - String

Opaque pagination cursor.

state - ChangesetState

Only include changesets with the given state.

onlyClosable - Boolean

Query only changesets that are either open or draft. This is used on the close page to list changesets that remain open. When set, passing state is not allowed.

reviewState - ChangesetReviewState

Only include changesets with the given review state.

Note: The COMMENTED and DISMISSED review states are not yet implemented.

checkState - ChangesetCheckState

Only include changesets with the given check state.

onlyPublishedByThisBatchChange - Boolean

Only return changesets that have been published by this batch change. Imported changesets will be omitted.

search - String

Search for changesets matching this query. Queries may include quoted substrings to match phrases, and words may be preceded by - to negate them.

onlyArchived - Boolean

Only return changesets that are archived in this batch change.

repo - ID

Only include changesets belonging to the given repository.

changesetCountsOverTime - [ChangesetCounts!]! The changeset counts over time, in 1-day intervals backwards from the point in time given in the "to" parameter.
Arguments
from - DateTime

Only include changeset counts up to this point in time (inclusive). Defaults to BatchChange.createdAt.

to - DateTime

Only include changeset counts up to this point in time (inclusive). Defaults to the current time.

includeArchived - Boolean

Include archived changesets in the calculation.

diffStat - DiffStat! The diff stat for all the changesets in the batch change.
currentSpec - BatchSpec! The last batch spec applied to this batch change, or an "empty" spec if the batch change has never had a spec applied.
bulkOperations - BulkOperationConnection! The bulk operations that have been run over this batch change.
Arguments
first - Int

Returns the first n entries from the list.

after - String

Opaque pagination cursor.

createdAfter - DateTime

Filter by createdAt value.

batchSpecs - BatchSpecConnection!

The batch specs that have been running on this batch change.

Site-admins can see all of them, non admins can only see batch specs that they created.

Arguments
first - Int

Returns the first n entries from the list.

after - String

Opaque pagination cursor.

includeLocallyExecutedSpecs - Boolean

Include locally executed (i.e. with src-cli) batch specs in the list of specs returned.

excludeEmptySpecs - Boolean

Exclude the empty batch specs that are initially created and applied to draft batch changes.

Example
{
  "id": "4",
  "namespace": Namespace,
  "name": "xyz789",
  "description": "xyz789",
  "state": "OPEN",
  "creator": User,
  "lastApplier": User,
  "viewerCanAdminister": true,
  "url": "abc123",
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z",
  "lastAppliedAt": "2007-12-03T10:15:30Z",
  "closedAt": "2007-12-03T10:15:30Z",
  "changesetsStats": ChangesetsStats,
  "changesets": ChangesetConnection,
  "changesetCountsOverTime": [ChangesetCounts],
  "diffStat": DiffStat,
  "currentSpec": BatchSpec,
  "bulkOperations": BulkOperationConnection,
  "batchSpecs": BatchSpecConnection
}

BatchChangeConnection

Description

A list of batch changes.

Fields
Field Name Description
nodes - [BatchChange!]! A list of batch changes.
totalCount - Int! The total number of batch changes in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [BatchChange],
  "totalCount": 123,
  "pageInfo": PageInfo
}

BatchChangeDescription

Description

A BatchChangeDescription describes a batch change.

Fields
Field Name Description
name - String! The name as parsed from the input.
description - String! The description as parsed from the input.
Example
{
  "name": "xyz789",
  "description": "abc123"
}

BatchChangeState

Description

The state of the batch change.

Values
Enum Value Description

OPEN

CLOSED

DRAFT

Example
"OPEN"

BatchChangesCodeHost

Description

A code host usable with batch changes. This service is accessible by the user it belongs to.

Fields
Field Name Description
externalServiceKind - ExternalServiceKind! The kind of external service.
externalServiceURL - String! The URL of the external service.
credential - BatchChangesCredential The configured credential, if any.
commitSigningConfiguration - CommitSigningConfiguration Configuration for commit signing, if any has been set up. Always nil if the code host type doesn't have commit signing support yet.
requiresSSH - Boolean! If true, some of the repositories on this code host require an SSH key to be configured.
requiresUsername - Boolean! If true, this code host requires credentials to have a username as well as a personal access token.
supportsCommitSigning - Boolean! If true, this code host can setup commit signing.
hasWebhooks - Boolean! If true, the code host has webhooks configured.
Example
{
  "externalServiceKind": "AWSCODECOMMIT",
  "externalServiceURL": "xyz789",
  "credential": BatchChangesCredential,
  "commitSigningConfiguration": GitHubApp,
  "requiresSSH": true,
  "requiresUsername": false,
  "supportsCommitSigning": false,
  "hasWebhooks": false
}

BatchChangesCodeHostConnection

Description

A connection of all code hosts usable with batch changes and accessible by the user this is requested on.

Fields
Field Name Description
nodes - [BatchChangesCodeHost!]! A list of code hosts.
totalCount - Int! The total number of configured external services in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [BatchChangesCodeHost],
  "totalCount": 987,
  "pageInfo": PageInfo
}

BatchChangesCredential

Description

A user token configured for batch changes use on the specified code host.

Fields
Field Name Description
id - ID! A globally unique identifier.
externalServiceKind - ExternalServiceKind! The kind of external service.
externalServiceURL - String! The URL of the external service.
sshPublicKey - String The public key to use on the external service for SSH keypair authentication. Not set if the credential doesn't support SSH access.
createdAt - DateTime! The date and time this token has been created at.
isSiteCredential - Boolean! Whether the configured credential is a site credential, that is available globally.
Example
{
  "id": "4",
  "externalServiceKind": "AWSCODECOMMIT",
  "externalServiceURL": "xyz789",
  "sshPublicKey": "xyz789",
  "createdAt": "2007-12-03T10:15:30Z",
  "isSiteCredential": false
}

BatchSpec

Description

A batch spec is an immutable description of the desired state of a batch change. To create a batch spec, use the createBatchSpec mutation.

Fields
Field Name Description
id - ID!

The unique ID for a batch spec.

The ID is unguessable (i.e., long and randomly generated, not sequential). Consider a batch change to fix a security vulnerability: the batch change author may prefer to prepare the batch change, including the description in private so that the window between revealing the problem and merging the fixes is as short as possible.

autoApplyEnabled - Boolean!

Future: Flag that calls applyBatchChange automatically when this execution completes. Useful for integrations with code monitoring etc.

TODO: Not implemented yet.

state - BatchSpecState! The current execution state of the batch spec. For manually created ones (src-cli workflow), this will always be COMPLETED. This is an accumulated state over all the associated workspaces for convenience.
originalInput - String! The original YAML or JSON input that was used to create this batch spec.
parsedInput - JSONValue! The parsed JSON value of the original input. If the original input was YAML, the YAML is converted to the equivalent JSON.
description - BatchChangeDescription! The BatchChangeDescription that describes this batch change.
applyPreview - ChangesetApplyPreviewConnection! Generates a preview showing the operations that would be performed if the batch spec was applied. This preview is not a guarantee, since the state of the changesets can change between the time the preview is generated and when the batch spec is applied.
Arguments
first - Int

Returns the first n entries from the list.

after - String

Opaque pagination cursor.

search - String

Search for changesets matching this query. Queries may include quoted substrings to match phrases, and words may be preceded by - to negate them.

currentState - ChangesetState

Search for changesets that are currently in this state.

action - ChangesetSpecOperation

Search for changesets that will have the given action performed.

publicationStates - [ChangesetSpecPublicationStateInput!]

If set, it will be assumed that these changeset specs will have their UI publication states set to the given values when the batch spec is applied.

An error will be returned if the same changeset spec ID is included more than once in the array, or if a changeset spec ID returned within this page has a publication state set in its spec.

Note: Unlike createBatchChange(), this query will not validate that all changeset specs in the array correspond to valid changeset specs within the batch spec, as they may not all be loaded on the current page.

changesetSpecs - ChangesetSpecConnection! The specs for changesets associated with this batch spec.
Arguments
first - Int
after - String
creator - User The user who created this batch spec. Their permissions will be honored when executing the batch spec. Null, if the user has been deleted.
createdAt - DateTime! The time when the batch spec was created at. At this time, it is also added to the queue for execution, if created from raw.
startedAt - DateTime The time when the execution started. Null, if the execution hasn't started yet, or if the batch spec was created in COMPLETED state.
finishedAt - DateTime The time when the execution finished. Null, if the execution hasn't finished yet, or if the batch spec was created in COMPLETED state. This value is the time of when the batch spec has been sealed.
namespace - Namespace! The namespace (either a user or organization) of the batch spec.
expiresAt - DateTime The date, if any, when this batch spec expires and is automatically purged. A batch spec never expires if it has been applied.
applyURL - String The URL of a web page that allows applying this batch spec and displays a preview of which changesets will be created by applying it. Null, if the execution has not finished yet.
viewerCanAdminister - Boolean! When true, the viewing user can apply this spec, modify it, and run workspace resolution jobs.
diffStat - DiffStat The diff stat for all the changeset specs in the batch spec. Null if state is not COMPLETED.
appliesToBatchChange - BatchChange The batch change this spec will update when applied. If it's null, the batch change doesn't yet exist.
supersedingBatchSpec - BatchSpec The newest version of this batch spec, as identified by its namespace and name. If this is the newest version, this field will be null.
viewerBatchChangesCodeHosts - BatchChangesCodeHostConnection! The code host connections required for applying this spec. Includes the credentials of the current user. Only returns useful information if state is COMPLETED.
Arguments
first - Int

Returns the first n code hosts from the list.

after - String

Opaque pagination cursor.

onlyWithoutCredential - Boolean

Only returns the code hosts for which the viewer doesn't have credentials.

onlyWithoutWebhooks - Boolean

Only returns code hosts that don't have webhooks configured.

workspaceResolution - BatchSpecWorkspaceResolution A wrapper for the workspace resolution on this batch spec. Contains access to all workspaces that have been resolved, as well as insight into the state of the resolution. Null, if the batch spec was created in COMPLETED state.
importingChangesets - ChangesetSpecConnection The set of changeset specs for importing changesets, as determined from the raw spec. Null, if not created through createBatchSpecFromRaw.
Arguments
first - Int
after - String
search - String
failureMessage - String Set when something about this batch spec is not right. For example, the input spec is invalid, or if ValidateChangesetSpecs throws an error when the last job completes.
allowIgnored - Boolean

If true, repos with a .batchignore file will still be included in the execution.

Null, if not created through createBatchSpecFromRaw.

allowUnsupported - Boolean

If true, repos on unsupported codehosts will be included in the execution. These cannot be published.

Null, if not created through createBatchSpecFromRaw.

noCache - Boolean

If true, workspaces will not run with cached results.

Null, if not created through createBatchSpecFromRaw.

viewerCanRetry - Boolean! If true, viewer can retry the batch spec execution by calling retryBatchSpecExecution.
source - BatchSpecSource! Whether the batch spec was created from the local src-cli workflow or remotely for server-side execution.
files - BatchSpecWorkspaceFileConnection The files that are mounted in the steps of a batch spec.
Arguments
first - Int

Returns the first n files from the list.

after - String

Opaque pagination cursor.

Example
{
  "id": "4",
  "autoApplyEnabled": true,
  "state": "PENDING",
  "originalInput": "abc123",
  "parsedInput": JSONValue,
  "description": BatchChangeDescription,
  "applyPreview": ChangesetApplyPreviewConnection,
  "changesetSpecs": ChangesetSpecConnection,
  "creator": User,
  "createdAt": "2007-12-03T10:15:30Z",
  "startedAt": "2007-12-03T10:15:30Z",
  "finishedAt": "2007-12-03T10:15:30Z",
  "namespace": Namespace,
  "expiresAt": "2007-12-03T10:15:30Z",
  "applyURL": "xyz789",
  "viewerCanAdminister": false,
  "diffStat": DiffStat,
  "appliesToBatchChange": BatchChange,
  "supersedingBatchSpec": BatchSpec,
  "viewerBatchChangesCodeHosts": BatchChangesCodeHostConnection,
  "workspaceResolution": BatchSpecWorkspaceResolution,
  "importingChangesets": ChangesetSpecConnection,
  "failureMessage": "xyz789",
  "allowIgnored": true,
  "allowUnsupported": true,
  "noCache": false,
  "viewerCanRetry": true,
  "source": "LOCAL",
  "files": BatchSpecWorkspaceFileConnection
}

BatchSpecConnection

Description

A list of batch specs.

Fields
Field Name Description
totalCount - Int! The total number of batch specs in the connection.
pageInfo - PageInfo! Pagination information.
nodes - [BatchSpec!]! A list of batch specs.
Example
{
  "totalCount": 123,
  "pageInfo": PageInfo,
  "nodes": [BatchSpec]
}

BatchSpecSource

Description

The possible sources of a batch spec.

Values
Enum Value Description

LOCAL

The spec was created from the local src-cli workflow.

REMOTE

This spec was created for remote server-side execution, e.g. from the web UI editor, or with src batch remote.
Example
"LOCAL"

BatchSpecState

Description

The possible states of a batch spec.

Values
Enum Value Description

PENDING

The spec is not yet enqueued for processing.

PROCESSING

This spec is being processed.

FAILED

This spec failed to be processed.

COMPLETED

This spec was processed successfully.

QUEUED

This spec is queued to be processed.

CANCELING

The execution is being canceled.

CANCELED

The execution has been canceled.
Example
"PENDING"

BatchSpecWorkspace

Description

The common interface for a batch spec workspace. Depending on access to the repository, either a HiddenBatchSpecWorkspace or a VisibleBatchSpecWorkspace will be serving this interface.

Fields
Field Name Description
id - ID! The unique ID for the workspace.
batchSpec - BatchSpec! Used for reverse querying.
onlyFetchWorkspace - Boolean! If true, only the files within the workspace will be fetched.
ignored - Boolean! If true, this workspace has been skipped, because some rule forced this. For now, the only one is a .batchignore file existing in the repository.
unsupported - Boolean! If true, this workspace has been skipped, because the code host on which the repository is hosted is not supported.
cachedResultFound - Boolean! Whether we found a task cache result.
stepCacheResultCount - Int! How many steps had a cached result.
queuedAt - DateTime The time when the workspace was enqueued for processing. Null, if not yet enqueued.
startedAt - DateTime The time when the workspace started processing. Null, if not yet started.
finishedAt - DateTime The time when the workspace finished processing. Null, if not yet finished.
state - BatchSpecWorkspaceState! The current state the workspace is in.
placeInQueue - Int The rank of this execution in the queue of the user. The value of this field is null if the execution has started.
placeInGlobalQueue - Int The rank of this execution in the global queue. The value of this field is null if the execution has started.
diffStat - DiffStat The diff stat over all created changeset specs. Null, if not yet finished or failed.
Possible Types
BatchSpecWorkspace Types

VisibleBatchSpecWorkspace

HiddenBatchSpecWorkspace

Example
{
  "id": "4",
  "batchSpec": BatchSpec,
  "onlyFetchWorkspace": true,
  "ignored": true,
  "unsupported": true,
  "cachedResultFound": false,
  "stepCacheResultCount": 987,
  "queuedAt": "2007-12-03T10:15:30Z",
  "startedAt": "2007-12-03T10:15:30Z",
  "finishedAt": "2007-12-03T10:15:30Z",
  "state": "SKIPPED",
  "placeInQueue": 987,
  "placeInGlobalQueue": 123,
  "diffStat": DiffStat
}

BatchSpecWorkspaceConnection

Description

A list of workspaces.

Fields
Field Name Description
totalCount - Int! The total number of workspaces in the connection.
pageInfo - PageInfo! Pagination information.
nodes - [BatchSpecWorkspace!]! A list of workspaces.
stats - BatchSpecWorkspacesStats! Statistics on the workspaces in this connection.
Example
{
  "totalCount": 123,
  "pageInfo": PageInfo,
  "nodes": [BatchSpecWorkspace],
  "stats": BatchSpecWorkspacesStats
}

BatchSpecWorkspaceEnvironmentVariable

Description

An enviroment variable passed to a command in a step.

Fields
Field Name Description
name - String! The variable name.
value - String The variable value. If null, the variable will be populated from a secret.
Example
{
  "name": "abc123",
  "value": "xyz789"
}

BatchSpecWorkspaceFile

Description

The metadata of a file being used in a batch spec step.

Fields
Field Name Description
id - ID! The ID of the file.
modifiedAt - DateTime! When the file was last touched.
createdAt - DateTime! When the file is initially created at.
updatedAt - DateTime! When the file is updated at.
path - String! The full path (relative to the root) of this file.
name - String! The base name (i.e., file name only) of this file.
isDirectory - Boolean! False because this is a file, not a directory.
content - String! The content of this file.
Arguments
startLine - Int

Return file content starting at line "startLine". A value <= 0 will be the start of the file.

endLine - Int

Return file content ending at line "endLine". A value < 0 or > totalLines will set endLine to the end of the file.

byteSize - Int! The file size in bytes.
totalLines - Int! Total line count for the Blob. Returns 0 for binary files.
binary - Boolean! Whether or not it is binary.
richHTML - String! The file rendered as rich HTML, or an empty string if it is not a supported rich file type. This HTML string is already escaped and thus is always safe to render.
Arguments
startLine - Int

Return richHTML content starting at line "startLine". A value <= 0 will be the start of the file.

endLine - Int

Return richHTML content ending at line "endLine". A value < 0 or > totalLines will set endLine to the end of the file.

url - String! The URL to this file (using the input revision specifier, which may not be immutable).
canonicalURL - String! The canonical URL to this file (using an immutable revision specifier).
changelistURL - String Not implemented.
externalURLs - [ExternalLink!]! The URLs to this file on external services.
highlight - HighlightedFile! Highlight the file.
Arguments
disableTimeout - Boolean!
highlightLongLines - Boolean

If highlightLongLines is true, lines which are longer than 2000 bytes are highlighted. 2000 bytes is enabled. This may produce a significant amount of HTML which some browsers (such as Chrome, but not Firefox) may have trouble rendering efficiently.

format - HighlightResponseFormat

Specifies which format/highlighting technique to use.

startLine - Int

Return highlight content starting at line "startLine". A value <= 0 will be the start of the file. Warning: Pagination only works with the HTML_PLAINTEXT format type at the moment.

endLine - Int

Return highlight content ending at line "endLine". A value < 0 or > totalLines will set endLine to the end of the file. Warning: Pagination only works with the HTML_PLAINTEXT format type at the moment.

languages - [String!]!

The language(s) determined based on the file's name and contents.

The resulting array may be empty if no language could be determined, or it may have multiple entries if the language is ambiguous.

If there are multiple entries, they will be sorted in descending order of likelihood.

Example
{
  "id": 4,
  "modifiedAt": "2007-12-03T10:15:30Z",
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z",
  "path": "abc123",
  "name": "xyz789",
  "isDirectory": false,
  "content": "abc123",
  "byteSize": 123,
  "totalLines": 987,
  "binary": false,
  "richHTML": "abc123",
  "url": "abc123",
  "canonicalURL": "xyz789",
  "changelistURL": "xyz789",
  "externalURLs": [ExternalLink],
  "highlight": HighlightedFile,
  "languages": ["abc123"]
}

BatchSpecWorkspaceFileConnection

Description

A list of BatchSpecMounts.

Fields
Field Name Description
totalCount - Int! The total number of files.
pageInfo - PageInfo! Pagination information.
nodes - [BatchSpecWorkspaceFile!]! A list of workspace files in a batch spec.
Example
{
  "totalCount": 987,
  "pageInfo": PageInfo,
  "nodes": [BatchSpecWorkspaceFile]
}

BatchSpecWorkspaceOutputVariable

Description

An output variable in a step.

Fields
Field Name Description
name - String! The variable name.
value - JSONValue! The variable value.
Example
{
  "name": "xyz789",
  "value": JSONValue
}

BatchSpecWorkspaceResolution

Description

A bag for all info around resolving workspaces.

Fields
Field Name Description
failureMessage - String Error message, if the evaluation failed.
startedAt - DateTime Set when evaluating workspaces begins.
finishedAt - DateTime Set when evaluating workspaces finished.
state - BatchSpecWorkspaceResolutionState! State of evaluating the workspaces.
workspaces - BatchSpecWorkspaceConnection! The actual list of determined workspaces.
Arguments
first - Int
after - String
orderBy - WorkspacesSortOrder

Not implemented.

search - String

Search for workspaces matching this query. Queries may include quoted substrings to match phrases, and words may be preceded by - to negate them. Currently, this supports searching repository names only. Repos that are not visible to the viewer will be omitted entirely when this argument is passed.

state - BatchSpecWorkspaceState

Filter workspaces by given state.

recentlyCompleted - BatchSpecWorkspaceConnection! Returns the workspaces where most recently a step completed that yielded a diff.
Arguments
first - Int
after - String
recentlyErrored - BatchSpecWorkspaceConnection! Returns the most recently failed workspace executions.
Arguments
first - Int
after - String
Example
{
  "failureMessage": "abc123",
  "startedAt": "2007-12-03T10:15:30Z",
  "finishedAt": "2007-12-03T10:15:30Z",
  "state": "QUEUED",
  "workspaces": BatchSpecWorkspaceConnection,
  "recentlyCompleted": BatchSpecWorkspaceConnection,
  "recentlyErrored": BatchSpecWorkspaceConnection
}

BatchSpecWorkspaceResolutionState

Description

State of the workspace resolution.

Values
Enum Value Description

QUEUED

Not yet started resolving. Will be picked up by a worker eventually.

PROCESSING

Currently resolving workspaces.

ERRORED

An error occured while resolving workspaces. Will be retried eventually.

FAILED

A fatal error occured while resolving workspaces. No retries will be made.

COMPLETED

Resolving workspaces finished successfully.
Example
"QUEUED"

BatchSpecWorkspaceStages

Description

Configuration and execution summary of a batch spec execution. This is mostly meant for internal consumption, for the timeline view.

Fields
Field Name Description
setup - [ExecutionLogEntry!]! Execution log entries related to setting up the workspace.
srcExec - [ExecutionLogEntry!]! Execution log entries related to running the steps of the batch spec.
teardown - [ExecutionLogEntry!]! Execution log entries related to tearing down the workspace.
Example
{
  "setup": [ExecutionLogEntry],
  "srcExec": [ExecutionLogEntry],
  "teardown": [ExecutionLogEntry]
}

BatchSpecWorkspaceState

Description

The states a workspace can be in.

Values
Enum Value Description

SKIPPED

The workspace will not be enqueued for execution, because either the workspace is unsupported/ignored or has 0 steps to execute.

PENDING

The workspace is not yet enqueued for execution.

QUEUED

Not yet started executing. Will be picked up by a worker eventually.

PROCESSING

Currently executing on the workspace.

FAILED

A fatal error occured while executing. No retries will be made.

COMPLETED

Execution finished successfully.

CANCELING

Execution is being canceled. This is an async process.

CANCELED

Execution has been canceled.
Example
"SKIPPED"

BatchSpecWorkspaceStep

Description

Description of one step in the execution of a workspace.

Fields
Field Name Description
number - Int! The number of the step.
run - String! The command to run.
container - String! The docker container image to use to run this command.
ifCondition - String The if condition, under which the step is executed. Null, if not set.
cachedResultFound - Boolean! True, if a cached result has been found.
skipped - Boolean! True, when the if condition evaluated that this step doesn't need to run.
outputLines - BatchSpecWorkspaceStepOutputLineConnection! The output logs, prefixed with either "stdout " or "stderr ". Null, if the step has not run yet.
Arguments
first - Int

Return the first N lines of logs.

after - String

Return the log lines after N lines.

startedAt - DateTime The time when the step started processing. Null, if not yet started.
finishedAt - DateTime The time when the step finished processing. Null, if not yet finished.
exitCode - Int The exit code of the command. Null, if not yet finished.
environment - [BatchSpecWorkspaceEnvironmentVariable!]! The environment variables passed to this step.
outputVariables - [BatchSpecWorkspaceOutputVariable!] The output variables the step produced. Null, if not yet finished.
diffStat - DiffStat The diff stat of the step result. Null, if not yet finished.
diff - PreviewRepositoryComparison The generated diff from this step. Null, if not yet finished.
Example
{
  "number": 987,
  "run": "xyz789",
  "container": "xyz789",
  "ifCondition": "abc123",
  "cachedResultFound": true,
  "skipped": true,
  "outputLines": BatchSpecWorkspaceStepOutputLineConnection,
  "startedAt": "2007-12-03T10:15:30Z",
  "finishedAt": "2007-12-03T10:15:30Z",
  "exitCode": 123,
  "environment": [BatchSpecWorkspaceEnvironmentVariable],
  "outputVariables": [BatchSpecWorkspaceOutputVariable],
  "diffStat": DiffStat,
  "diff": PreviewRepositoryComparison
}

BatchSpecWorkspaceStepOutputLineConnection

Description

A list of Output lines from a Batch spec workspace.

Fields
Field Name Description
totalCount - Int! The total number of output lines in the connection.
pageInfo - PageInfo! Pagination information.
nodes - [String!]! A list of output lines.
Example
{
  "totalCount": 987,
  "pageInfo": PageInfo,
  "nodes": ["abc123"]
}

BatchSpecWorkspacesStats

Description

Statistics on all workspaces in a connection.

Fields
Field Name Description
errored - Int! Number of errored workspaces.
completed - Int! Number of completed workspaces.
processing - Int! Number of processing workspaces.
queued - Int! Number of queued workspaces.
ignored - Int! Number of ignored workspaces.
Example
{
  "errored": 123,
  "completed": 123,
  "processing": 987,
  "queued": 987,
  "ignored": 123
}

BehindAheadCounts

Description

A set of Git behind/ahead counts for one commit relative to another.

Fields
Field Name Description
behind - Int! The number of commits behind the other commit.
ahead - Int! The number of commits ahead of the other commit.
Example
{"behind": 987, "ahead": 987}

BidirectionalPageInfo

Description

Pagination information for bi-directional pagination. See https://facebook.github.io/relay/graphql/connections.htm#sec-undefined.PageInfo.

Fields
Field Name Description
startCursor - String When paginating backwards, the cursor to continue.
endCursor - String When paginating forwards, the cursor to continue.
hasPreviousPage - Boolean! When paginating backwards, are there more items?
hasNextPage - Boolean! When paginating forwards, are there more items?
Example
{
  "startCursor": "xyz789",
  "endCursor": "xyz789",
  "hasPreviousPage": false,
  "hasNextPage": true
}

BigInt

Description

An arbitrarily large integer encoded as a decimal string.

Example
{}

Boolean

Description

The Boolean scalar type represents true or false.

Example
true

BulkOperation

Description

A bulk operation represents a group of jobs run over a set of changesets in a batch change.

Fields
Field Name Description
id - ID! The unique ID for the bulk operation.
type - BulkOperationType! The type of task that is run.
state - BulkOperationState! The current state of the bulk operation.
progress - Float! The progress to completion of all executions involved in this bulk operation. Value ranges from 0.0 to 1.0.
errors - [ChangesetJobError!]! The list of all errors that occured while processing the bulk action.
createdAt - DateTime! The time the bulk operation was created at.
finishedAt - DateTime The time the bulk operation finished. Also set, when some operations failed. Null, when some operations are still processing.
initiator - User! The user who triggered this bulk operation.
changesetCount - Int! The number of changesets involved in this bulk operation.
Example
{
  "id": "4",
  "type": "COMMENT",
  "state": "PROCESSING",
  "progress": 123.45,
  "errors": [ChangesetJobError],
  "createdAt": "2007-12-03T10:15:30Z",
  "finishedAt": "2007-12-03T10:15:30Z",
  "initiator": User,
  "changesetCount": 123
}

BulkOperationConnection

Description

A list of bulk operations.

Fields
Field Name Description
totalCount - Int! The total number of bulk operations in the connection.
pageInfo - PageInfo! Pagination information.
nodes - [BulkOperation!]! A list of bulk operations.
Example
{
  "totalCount": 123,
  "pageInfo": PageInfo,
  "nodes": [BulkOperation]
}

BulkOperationState

Description

All valid states a bulk operation can be in.

Values
Enum Value Description

PROCESSING

The bulk operation is still processing on some changesets.

COMPLETED

No operations are still running and all of them finished without error.

FAILED

No operations are still running and at least one of them finished with an error.
Example
"PROCESSING"

BulkOperationType

Description

The available types of jobs that can be run over a batch change.

Values
Enum Value Description

COMMENT

Bulk post comments over all involved changesets.

DETACH

Bulk detach changesets from a batch change.

REENQUEUE

Bulk reenqueue failed changesets.

MERGE

Bulk merge changesets.

CLOSE

Bulk close changesets.

PUBLISH

Bulk publish changesets.

EXPORT

Export changesets.
Example
"COMMENT"

Changeset

Description

A changeset on a codehost.

Fields
Field Name Description
id - ID! The unique ID for the changeset.
batchChanges - BatchChangeConnection! The batch changes that contain this changeset.
Arguments
first - Int

Returns the first n batch changes from the list.

after - String

Opaque pagination cursor.

state - BatchChangeState

Only return batch changes in this state. If states is also specified, it will take precedence over state.

states - [BatchChangeState!]

Only return batch changes in any of these states. If state is also specified, states will take precedence over it.

viewerCanAdminister - Boolean

Only include batch changes that the viewer can administer.

state - ChangesetState! The state of the changeset.
createdAt - DateTime! The date and time when the changeset was created.
updatedAt - DateTime! The date and time when the changeset was updated.
nextSyncAt - DateTime The date and time when the next changeset sync is scheduled, or null if none is scheduled.
Possible Types
Changeset Types

HiddenExternalChangeset

ExternalChangeset

Example
{
  "id": "4",
  "batchChanges": BatchChangeConnection,
  "state": "UNPUBLISHED",
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z",
  "nextSyncAt": "2007-12-03T10:15:30Z"
}

ChangesetApplyPreview

Description

A preview for which actions applyBatchChange would result in when called at the point of time this preview was created at.

Example
VisibleChangesetApplyPreview

ChangesetApplyPreviewConnection

Description

A list of preview entries.

Fields
Field Name Description
totalCount - Int! The total number of entries in the connection.
pageInfo - PageInfo! Pagination information.
nodes - [ChangesetApplyPreview!]! A list of preview entries.
stats - ChangesetApplyPreviewConnectionStats! Stats on the elements in this connnection. Does not respect pagination parameters.
Example
{
  "totalCount": 987,
  "pageInfo": PageInfo,
  "nodes": [VisibleChangesetApplyPreview],
  "stats": ChangesetApplyPreviewConnectionStats
}

ChangesetApplyPreviewConnectionStats

Description

Aggregated stats on nodes in this connection.

Fields
Field Name Description
push - Int! The amount of new commits from the batch change in this operation.
update - Int! The amount of existing changeset that will be updated from the batch change in this operation.
undraft - Int! The amount of changesets that will be un-drafted from the batch change in this operation.
publish - Int! The amount of changesets that will be pubished from the batch change in this operation.
publishDraft - Int! The amount of changesets that will be published as a draft from the batch change in this operation.
sync - Int! The amount of changesets that will be synced from the batch change in this operation.
import - Int! The amount of changesets that will be imported from the batch change in this operation.
close - Int! The amount of changesets that will be closed from the batch change in this operation.
reopen - Int! The amount of changesets that will be re-opened from the batch change in this operation.
sleep - Int! Internal operation to get around slow code host updates.
detach - Int! The amount of changesets that will be removed from the batch change in this operation.
archive - Int! The amount of changesets that will be archived from the batch change in this operation.
added - Int! The amount of changesets that are added to the batch change in this operation.
modified - Int! The amount of changesets that are already attached to the batch change and modified in this operation.
removed - Int! The amount of changesets that are disassociated from the batch change in this operation.
reattach - Int! The amount of changesets that will be re-added from the batch change in this operation.
Example
{
  "push": 123,
  "update": 987,
  "undraft": 987,
  "publish": 123,
  "publishDraft": 123,
  "sync": 123,
  "import": 987,
  "close": 987,
  "reopen": 123,
  "sleep": 987,
  "detach": 987,
  "archive": 123,
  "added": 123,
  "modified": 987,
  "removed": 123,
  "reattach": 987
}

ChangesetCheckState

Description

The state of checks (e.g., for continuous integration) on a changeset.

Values
Enum Value Description

PENDING

PASSED

FAILED

Example
"PENDING"

ChangesetConnection

Description

A list of changesets.

Fields
Field Name Description
nodes - [Changeset!]! A list of changesets.
totalCount - Int! The total number of changesets in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [Changeset],
  "totalCount": 123,
  "pageInfo": PageInfo
}

ChangesetCounts

Description

The counts of changesets in certain states at a specific point in time.

Fields
Field Name Description
date - DateTime! The point in time these counts were recorded.
total - Int! The total number of changesets.
merged - Int! The number of merged changesets.
closed - Int! The number of closed changesets.
draft - Int! The number of draft changesets (independent of review state).
open - Int! The number of open changesets (independent of review state).
openApproved - Int! The number of changesets that are both open and approved.
openChangesRequested - Int! The number of changesets that are both open and have requested changes.
openPending - Int! The number of changesets that are both open and are pending review.
Example
{
  "date": "2007-12-03T10:15:30Z",
  "total": 987,
  "merged": 987,
  "closed": 123,
  "draft": 987,
  "open": 987,
  "openApproved": 123,
  "openChangesRequested": 123,
  "openPending": 987
}

ChangesetDescription

Description

All possible types of changesets that can be specified in a changeset spec.

Example
ExistingChangesetReference

ChangesetEvent

Description

A changeset event in a code host (e.g., a comment on a pull request on GitHub).

Fields
Field Name Description
id - ID! The unique ID for the changeset event.
changeset - ExternalChangeset! The changeset this event belongs to.
createdAt - DateTime! The date and time when the changeset was created.
Example
{
  "id": "4",
  "changeset": ExternalChangeset,
  "createdAt": "2007-12-03T10:15:30Z"
}

ChangesetEventConnection

Description

A list of changeset events.

Fields
Field Name Description
nodes - [ChangesetEvent!]! A list of changeset events.
totalCount - Int! The total number of changeset events in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [ChangesetEvent],
  "totalCount": 123,
  "pageInfo": PageInfo
}

ChangesetJobError

Description

A reported error on a changeset in a bulk operation.

Fields
Field Name Description
changeset - Changeset! The changeset this error is related to.
error - String The error message. Null, if the changeset is not accessible by the requesting user.
Example
{
  "changeset": Changeset,
  "error": "abc123"
}

ChangesetLabel

Description

A label attached to a changeset on a code host.

Fields
Field Name Description
text - String! The label's text.
color - String! The label's color, as a hex color code without the . For example: "93ba13".
description - String An optional description of the label.
Example
{
  "text": "abc123",
  "color": "xyz789",
  "description": "xyz789"
}

ChangesetReviewState

Description

The review state of a changeset.

Values
Enum Value Description

APPROVED

CHANGES_REQUESTED

PENDING

COMMENTED

DISMISSED

Example
"APPROVED"

ChangesetSpec

Description

A changeset spec is an immutable description of the desired state of a changeset in a batch change. To create a changeset spec, use the createChangesetSpec mutation.

Fields
Field Name Description
id - ID!

The unique ID for a changeset spec.

The ID is unguessable (i.e., long and randomly generated, not sequential). This is important even though repository permissions also apply to viewers of changeset specs, because being allowed to view a repository should not entitle a person to view all not-yet-published changesets for that repository. Consider a batch change to fix a security vulnerability: the batch change author may prefer to prepare all of the changesets in private so that the window between revealing the problem and merging the fixes is as short as possible.

type - ChangesetSpecType! The type of changeset spec.
expiresAt - DateTime The date, if any, when this changeset spec expires and is automatically purged. A changeset spec never expires (and this field is null) if its batch spec has been applied.
Possible Types
ChangesetSpec Types

HiddenChangesetSpec

VisibleChangesetSpec

Example
{
  "id": "4",
  "type": "EXISTING",
  "expiresAt": "2007-12-03T10:15:30Z"
}

ChangesetSpecConnection

Description

A list of changeset specs.

Fields
Field Name Description
totalCount - Int! The total number of changeset specs in the connection.
pageInfo - PageInfo! Pagination information.
nodes - [ChangesetSpec!]! A list of changeset specs.
Example
{
  "totalCount": 123,
  "pageInfo": PageInfo,
  "nodes": [ChangesetSpec]
}

ChangesetSpecDelta

Description

Description of the current changeset state vs the changeset spec desired state.

Fields
Field Name Description
titleChanged - Boolean! When run, the title of the changeset will be updated.
bodyChanged - Boolean! When run, the body of the changeset will be updated.
undraft - Boolean! When run, the changeset will be taken out of draft mode.
baseRefChanged - Boolean! When run, the target branch of the changeset will be updated.
diffChanged - Boolean! When run, a new commit will be created on the branch of the changeset.
commitMessageChanged - Boolean! When run, a new commit will be created on the branch of the changeset.
authorNameChanged - Boolean! When run, a new commit in the name of the specified author will be created on the branch of the changeset.
authorEmailChanged - Boolean! When run, a new commit in the name of the specified author will be created on the branch of the changeset.
Example
{
  "titleChanged": false,
  "bodyChanged": false,
  "undraft": false,
  "baseRefChanged": true,
  "diffChanged": false,
  "commitMessageChanged": true,
  "authorNameChanged": false,
  "authorEmailChanged": true
}

ChangesetSpecOperation

Description

This enum declares all operations supported by the reconciler.

Values
Enum Value Description

PUSH

Push a new commit to the code host.

UPDATE

Update the existing changeset on the codehost. This is purely the changeset resource on the code host, not the git commit. For updates to the commit, see 'PUSH'.

UNDRAFT

Move the existing changeset out of being a draft.

PUBLISH

Publish a changeset to the codehost.

PUBLISH_DRAFT

Publish a changeset to the codehost as a draft changeset. (Only on supported code hosts).

SYNC

Sync the changeset with the current state on the codehost.

IMPORT

Import an existing changeset from the code host with the ExternalID from the spec.

CLOSE

Close the changeset on the codehost.

REOPEN

Reopen the changeset on the codehost.

SLEEP

Internal operation to get around slow code host updates.

DETACH

The changeset is removed from some of the associated batch changes.

ARCHIVE

The changeset is kept in the batch change, but it's marked as archived.

REATTACH

The changeset is re-added to the batch change.
Example
"PUSH"

ChangesetSpecPublicationStateInput

Description

A ChangesetSpecPublicationStateInput is a tuple containing a changeset spec ID and its desired UI publication state.

Fields
Input Field Description
changesetSpec - ID! The changeset spec ID.
publicationState - PublishedValue! The desired publication state.
Example
{
  "changesetSpec": "4",
  "publicationState": PublishedValue
}

ChangesetSpecType

Description

The type of the changeset spec.

Values
Enum Value Description

EXISTING

References an existing changeset on a code host to be imported.

BRANCH

References a branch and a patch to be applied to create the changeset from.
Example
"EXISTING"

ChangesetState

Description

The visual state a changeset is currently in.

Values
Enum Value Description

UNPUBLISHED

The changeset has not been marked as to be published.

FAILED

The changeset reconciler ran into a problem while processing the changeset that can't be fixed by retrying.

RETRYING

The changeset reconciler ran into a problem while processing the changeset and will retry it for a number of retries.

SCHEDULED

The changeset is scheduled, and will be enqueued when its turn comes in Sourcegraph's rollout window.

PROCESSING

The changeset reconciler is currently computing the delta between the If a delta exists, the reconciler tries to update the state of the changeset on the code host and on Sourcegraph to the desired state.

OPEN

The changeset is published, not being reconciled and open on the code host.

DRAFT

The changeset is published, not being reconciled and in draft state on the code host.

CLOSED

The changeset is published, not being reconciled and closed on the code host.

MERGED

The changeset is published, not being reconciled and merged on the code host.

READONLY

The changeset is published, and is now read-only, most likely due to the repository being archived.

DELETED

The changeset is published, not being reconciled and has been deleted on the code host.
Example
"UNPUBLISHED"

ChangesetsStats

Description

Used in the batch change page for the overview component.

Fields
Field Name Description
unpublished - Int! The count of unpublished changesets.
draft - Int! The count of draft changesets.
open - Int! The count of open changesets.
merged - Int! The count of merged changesets.
closed - Int! The count of closed changesets.
deleted - Int! The count of deleted changesets.
retrying - Int! The count of changesets in retrying state.
failed - Int! The count of changesets in failed state.
scheduled - Int! The count of changesets in the scheduled state.
processing - Int! The count of changesets that are currently processing or enqueued to be.
archived - Int! The count of archived changesets.
total - Int! The count of all changesets.
isCompleted - Boolean! If true, then all changesets are either merged or closed. This indicates that the batch change is completed.
percentComplete - Int! The count of changesets that are complete (i.e in a merged or closed state) and not archived or deleted.
Example
{
  "unpublished": 123,
  "draft": 123,
  "open": 987,
  "merged": 123,
  "closed": 987,
  "deleted": 987,
  "retrying": 123,
  "failed": 123,
  "scheduled": 123,
  "processing": 987,
  "archived": 123,
  "total": 987,
  "isCompleted": true,
  "percentComplete": 987
}

CheckMirrorRepositoryConnectionResult

Description

The result for Mutation.checkMirrorRepositoryConnection.

Fields
Field Name Description
error - String The error message encountered during the update operation, if any. If null, then the connection check succeeded.
Example
{"error": "abc123"}

ChunkMatch

Description

A set of matched ranges contained in a chunk of contiguous lines.

Fields
Field Name Description
content - String! The contiguous set of full lines which contain the matches in ranges.
contentStart - Position! The location of the beginning of content.
ranges - [Range!]! The set of ranges within the content that matched the search query.
Example
{
  "content": "abc123",
  "contentStart": Position,
  "ranges": [Range]
}

ClientConfigurationDetails

Description

Configuration details for the browser extension, editor extensions, etc.

Fields
Field Name Description
contentScriptUrls - [String!]! The list of phabricator/gitlab/bitbucket/etc instance URLs that specifies which pages the content script will be injected into.
parentSourcegraph - ParentSourcegraphDetails! Returns details about the parent Sourcegraph instance.
Example
{
  "contentScriptUrls": ["abc123"],
  "parentSourcegraph": ParentSourcegraphDetails
}

CloneStatus

Description

The clone status of a repository.

Values
Enum Value Description

NOT_CLONED

CLONING

CLONED

Example
"NOT_CLONED"

CloningProgress

Description

FOR INTERNAL USE ONLY: A status message produced when repositories are being cloned

Fields
Field Name Description
message - String! The message of this status message
Example
{"message": "xyz789"}

CodeHost

Description

A specific code host, like github.com.

Fields
Field Name Description
id - ID! The id of the code host.
kind - ExternalServiceKind! The type of code host, e.g. GITHUB.
url - String! The url for the code host, e.g. github.com.
apiRateLimitQuota - Int A amount of API requests Sourcegraph can send to the code host.
apiRateLimitIntervalSeconds - Int How often API rate limits get reset. Defined in seconds.
gitRateLimitQuota - Int A amount of git requests Sourcegraph can send to the code host.
gitRateLimitIntervalSeconds - Int How often git rate limits get reset. Defined in seconds.
externalServices - ExternalServiceConnection! All external services that refer to this code host.
Arguments
first - Int
after - String
Example
{
  "id": "4",
  "kind": "AWSCODECOMMIT",
  "url": "abc123",
  "apiRateLimitQuota": 123,
  "apiRateLimitIntervalSeconds": 987,
  "gitRateLimitQuota": 987,
  "gitRateLimitIntervalSeconds": 123,
  "externalServices": ExternalServiceConnection
}

CodeHostConnection

Description

A list of code hosts.

Fields
Field Name Description
isMigrationDone - Boolean! Only when this flag is true, the connection can be trusted to be complete. This will stop existing in Sourcegraph 5.3 when the migration is ensured to be complete.
nodes - [CodeHost!]! A list of code hosts.
pageInfo - PageInfo! Pagination information.
totalCount - Int! The total number of records in this result set.
Example
{
  "isMigrationDone": false,
  "nodes": [CodeHost],
  "pageInfo": PageInfo,
  "totalCount": 123
}

CodeIntelCommit

Description

A Code Intel Commit.

Fields
Field Name Description
id - ID! The globally addressable ID for this commit.
oid - GitObjectID! This commit's Git object ID (OID), a 40-character SHA-1 hash.
abbreviatedOID - String! The abbreviated form of this commit's OID.
url - String! The URL to this commit (using the input revision specifier, which may not be immutable).
repository - CodeIntelRepository! The repository that contains this commit.
Example
{
  "id": "4",
  "oid": GitObjectID,
  "abbreviatedOID": "xyz789",
  "url": "xyz789",
  "repository": CodeIntelRepository
}

CodeIntelExternalRepository

Description

A repository on an external service (such as GitHub, GitLab, Phabricator, etc.).

Fields
Field Name Description
serviceType - String! The type of external service where this repository resides. Example: "github", "gitlab", etc.
serviceID - String! The particular instance of the external service where this repository resides. Its value is opaque but typically consists of the canonical base URL to the service. Example: For GitHub.com, this is "https://github.com/".
Example
{
  "serviceType": "abc123",
  "serviceID": "abc123"
}

CodeIntelGitBlob

Description

A gitblob resolver specific to code intel.

Fields
Field Name Description
path - String! The full path (relative to the root) of this tree.
name - String! The base name (i.e., last path component only) of this tree.
commit - CodeIntelCommit! The Git commit containing this tree.
url - String! The URL to this tree (using the input revision specifier, which may not be immutable).
repository - CodeIntelRepository! The repository containing this tree.
content - String! The content of this blob.
Arguments
startLine - Int

Return file content starting at line "startLine". A value <= 0 will be the start of the file.

endLine - Int

Return file content ending at line "endLine". A value < 0 or > totalLines will set endLine to the end of the file.

Example
{
  "path": "xyz789",
  "name": "abc123",
  "commit": CodeIntelCommit,
  "url": "abc123",
  "repository": CodeIntelRepository,
  "content": "xyz789"
}

CodeIntelGitObject

Description

A git object that matches a git object type and glob pattern. This type is used by the UI to preview what names match a code intelligence policy in a given repository.

Fields
Field Name Description
name - String! The relevant branch or tag name.
rev - String! The full 40-char revhash.
committedAt - DateTime! The time that the underlying commit was created.
Example
{
  "name": "abc123",
  "rev": "xyz789",
  "committedAt": "2007-12-03T10:15:30Z"
}

CodeIntelGitTree

Description

A Code Intel Git Tree.

Fields
Field Name Description
path - String! The full path (relative to the root) of this tree.
name - String! The base name (i.e., last path component only) of this tree.
commit - CodeIntelCommit! The Git commit containing this tree.
url - String! The URL to this tree (using the input revision specifier, which may not be immutable).
repository - CodeIntelRepository! The repository containing this tree.
content - String! The content of this blob.
Arguments
startLine - Int

Return file content starting at line "startLine". A value <= 0 will be the start of the file.

endLine - Int

Return file content ending at line "endLine". A value < 0 or > totalLines will set endLine to the end of the file.

Example
{
  "path": "abc123",
  "name": "xyz789",
  "commit": CodeIntelCommit,
  "url": "xyz789",
  "repository": CodeIntelRepository,
  "content": "xyz789"
}

CodeIntelIndexer

Description

Describes a precise code-intel indexer.

Fields
Field Name Description
key - String! The language ecosystem that this indexer supports.
name - String! Name of the precise code-intel indexer.
url - String! URL to the source of the indexer e.g. https://github.com/sourcegraph/lsif-go
imageName - String A Docker image name used to distribute the indexer to the executor for via auto-indexing.
Example
{
  "key": "abc123",
  "name": "xyz789",
  "url": "abc123",
  "imageName": "abc123"
}

CodeIntelRepository

Description

A codeintel repository is a Git source control repository that is mirrored from some origin code host and it is specific to code intel.

Fields
Field Name Description
id - ID! The globally addressable ID for this commit.
name - String!

The repository's name, as a path with one or more components. It conventionally consists of the repository's hostname and path (joined by "/"), minus any suffixes (such as ".git"). Examples:

  • github.com/foo/bar
  • my-code-host.example.com/myrepo
  • myrepo
url - String! The URL to this repository.
externalRepository - CodeIntelExternalRepository Information about this repository from the external service that it originates from (such as GitHub, GitLab, Phabricator, etc.). Only populated when used as part of repository list previews for configuration policies.
Example
{
  "id": "4",
  "name": "abc123",
  "url": "xyz789",
  "externalRepository": CodeIntelExternalRepository
}

CodeIntelRepositorySummary

Description

A summary of the most recent upload and index status.

Fields
Field Name Description
recentActivity - [PreciseIndex!]! A list of recent precise indexes for a specific repository. This list contains processing, recently queued, and the most recently processed precise indexes for each distinct indexer and root.
lastUploadRetentionScan - DateTime The last time uploads of this repository were checked against data retention policies.
lastIndexScan - DateTime The last time this repository was considered for auto-indexing job scheduling.
availableIndexers - [InferredAvailableIndexers!]! The additionally available indexers that could be indexed but haven't been indexed.
limitError - String If inference of the repository contents hit a limit its error description will available here.
Example
{
  "recentActivity": [PreciseIndex],
  "lastUploadRetentionScan": "2007-12-03T10:15:30Z",
  "lastIndexScan": "2007-12-03T10:15:30Z",
  "availableIndexers": [InferredAvailableIndexers],
  "limitError": "abc123"
}

CodeIntelRepositoryWithConfiguration

Description

A repository paired with a list of precise indexers (used by CodeIntelSummary).

Fields
Field Name Description
repository - CodeIntelRepository! The repository.
indexers - [IndexerWithCount!]! The precise indexers available for the repository.
Example
{
  "repository": CodeIntelRepository,
  "indexers": [IndexerWithCount]
}

CodeIntelRepositoryWithConfigurationConnection

Description

A list of repositories paired with a list of precise indexers (used by CodeIntelSummary).

Fields
Field Name Description
nodes - [CodeIntelRepositoryWithConfiguration!]! The repository and indexer count.
totalCount - Int The total number of results (over all pages) in this list.
pageInfo - PageInfo! Metadata about the current page of results.
Example
{
  "nodes": [CodeIntelRepositoryWithConfiguration],
  "totalCount": 123,
  "pageInfo": PageInfo
}

CodeIntelRepositoryWithError

Description

A repository paired with a count of precise indexing errors (used by CodeIntelSummary).

Fields
Field Name Description
repository - CodeIntelRepository! The repository.
count - Int! The number of precise indexing errors in the repository.
Example
{"repository": CodeIntelRepository, "count": 987}

CodeIntelRepositoryWithErrorConnection

Description

A list of repositories paired with a count of precise indexing errors (used by CodeIntelSummary).

Fields
Field Name Description
nodes - [CodeIntelRepositoryWithError!]! The repository and error count.
totalCount - Int The total number of results (over all pages) in this list.
pageInfo - PageInfo! Metadata about the current page of results.
Example
{
  "nodes": [CodeIntelRepositoryWithError],
  "totalCount": 987,
  "pageInfo": PageInfo
}

CodeIntelSummary

Description

A summary of code intelligence on the instance.

Fields
Field Name Description
numRepositoriesWithCodeIntelligence - Int! The number of repositories with precise index records.
repositoriesWithErrors - CodeIntelRepositoryWithErrorConnection! A list of repositories with precise index errors.
Arguments
first - Int

When specified, indicates that this request should be paginated and the first N results (relative to the cursor) should be returned. i.e. how many results to return per page.

after - String

When specified, indicates that this request should be paginated and to fetch results starting at this cursor.

A future request can be made for more results by passing in the 'CodeIntelRepositoryWithErrorConnection.pageInfo.endCursor' that is returned.

repositoriesWithConfiguration - CodeIntelRepositoryWithConfigurationConnection A list of repositories with configurable auto-indexing jobs.
Arguments
first - Int

When specified, indicates that this request should be paginated and the first N results (relative to the cursor) should be returned. i.e. how many results to return per page.

after - String

When specified, indicates that this request should be paginated and to fetch results starting at this cursor.

A future request can be made for more results by passing in the 'CodeIntelRepositoryWithErrorConnection.pageInfo.endCursor' that is returned.

Example
{
  "numRepositoriesWithCodeIntelligence": 987,
  "repositoriesWithErrors": CodeIntelRepositoryWithErrorConnection,
  "repositoriesWithConfiguration": CodeIntelRepositoryWithConfigurationConnection
}

CodeIntelligenceCommitGraph

Description

Information and status related to the commit graph of this repository calculated for use by code intelligence features.

Fields
Field Name Description
stale - Boolean! Whether or not the commit graph needs to be updated.
updatedAt - DateTime When, if ever, the commit graph was last refreshed.
Example
{
  "stale": false,
  "updatedAt": "2007-12-03T10:15:30Z"
}

CodeIntelligenceConfigurationPolicy

Description

A configuration policy that applies to a set of Git objects matching an associated pattern. Each policy has optional data retention and auto-indexing schedule configuration attached. A policy can be applied globally or on a per-repository basis.

Fields
Field Name Description
id - ID! The ID.
name - String! A description of the configuration policy.
repository - CodeIntelRepository The repository to which this configuration policy applies.
repositoryPatterns - [String!] The set of name patterns matching repositories to which this configuration policy applies.
type - GitObjectType! The type of Git object described by the configuration policy.
pattern - String! A pattern matching the name of the matching Git object.
protected - Boolean! Protected policies may not be deleted (or created directly by users).
retentionEnabled - Boolean! Whether or not this configuration policy affects data retention rules.
retentionDurationHours - Int The max age of data retained by this configuration policy.
retainIntermediateCommits - Boolean! If the matching Git object is a branch, setting this value to true will also retain all data used to resolve queries for any commit on the matching branches. Setting this value to false will only consider the tip of the branch.
indexingEnabled - Boolean! Whether or not this configuration policy affects auto-indexing schedules.
indexCommitMaxAgeHours - Int The max age of commits indexed by this configuration policy.
indexIntermediateCommits - Boolean! If the matching Git object is a branch, setting this value to true will also index all commits on the matching branches. Setting this value to false will only consider the tip of the branch.
embeddingsEnabled - Boolean! Whether or not this configuration policy affects embeddings.
Example
{
  "id": 4,
  "name": "xyz789",
  "repository": CodeIntelRepository,
  "repositoryPatterns": ["abc123"],
  "type": "GIT_COMMIT",
  "pattern": "xyz789",
  "protected": false,
  "retentionEnabled": false,
  "retentionDurationHours": 123,
  "retainIntermediateCommits": true,
  "indexingEnabled": true,
  "indexCommitMaxAgeHours": 987,
  "indexIntermediateCommits": false,
  "embeddingsEnabled": false
}

CodeIntelligenceConfigurationPolicyConnection

Description

A list of code intelligence configuration policies.

Fields
Field Name Description
nodes - [CodeIntelligenceConfigurationPolicy!]! A list of code intelligence configuration policies.
totalCount - Int The total number of policies in this result set.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [CodeIntelligenceConfigurationPolicy],
  "totalCount": 123,
  "pageInfo": PageInfo
}

CodeIntelligenceRetentionPolicyMatch

Description

A retention policy match candidate.

Fields
Field Name Description
configurationPolicy - CodeIntelligenceConfigurationPolicy The actual retention policy.
matches - Boolean! Whether the retention policy matches the upload or not. False values may be returned if non-matching policies are requested for inclusion.
protectingCommits - [String!] A list of commits that are visible to this upload for which this retention policy applies. It is empty if the policy applies directly to the commit associated with the upload.
Example
{
  "configurationPolicy": CodeIntelligenceConfigurationPolicy,
  "matches": false,
  "protectingCommits": ["xyz789"]
}

CodeIntelligenceRetentionPolicyMatchesConnection

Description

A list of code intelligence retention policy match candidates.

Fields
Field Name Description
nodes - [CodeIntelligenceRetentionPolicyMatch!]! A list of code intelligence retention policies matches.
totalCount - Int The total number of policies in this result set.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [CodeIntelligenceRetentionPolicyMatch],
  "totalCount": 987,
  "pageInfo": PageInfo
}

CodeownersFileEntry

Description

The entity is an owner because they were manually assigned as an owner.

Fields
Field Name Description
title - String! Descriptive title to display in the UI for the determination.
description - String! More detailed description to display in the UI for the determination.
codeownersFile - File2! Either GitBlob or VirtualFile. This points to the CODEOWNERS file that yielded the determination.
ruleLineMatch - Int! The line in the CODEOWNERS file that matched for this determination.
Example
{
  "title": "abc123",
  "description": "xyz789",
  "codeownersFile": File2,
  "ruleLineMatch": 987
}

CodeownersFileInput

Description

CodeownersFileInput represents the input for ingesting codeowners files

Fields
Input Field Description
fileContents - String! fileContents is the text of the codeowners file
repoID - ID The repo ID to ingest the file for. Cannot be set with repositoryName.
repoName - String The repo name to ingest the file for. Cannot be set with repositoryID.
Example
{
  "fileContents": "xyz789",
  "repoID": "4",
  "repoName": "xyz789"
}

CodeownersIngestedFile

Description

CodeownersIngestedFile represents a manually ingested Codeowners file.

Fields
Field Name Description
id - ID! A graphql ID for this file.
contents - String! The string contents of the codeowners file.
repository - Repository! The repository this codeowners file has been manually ingested for.
createdAt - DateTime! The creation date of this codeowners file.
updatedAt - DateTime! The last updated date of this codeowners file.
Example
{
  "id": "4",
  "contents": "abc123",
  "repository": Repository,
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z"
}

CodeownersIngestedFileConnection

Description

A list of CodeownersIngestedFiles.

Fields
Field Name Description
totalCount - Int! The total count of items in the connection.
pageInfo - PageInfo! The pagination info for the connection.
nodes - [CodeownersIngestedFile!]! The current page of codeowners files in this connection.
Example
{
  "totalCount": 987,
  "pageInfo": PageInfo,
  "nodes": [CodeownersIngestedFile]
}

CodyConfigFeatures

Description

Cody Config features contains information about which LLM features are enabled for this SG instance

Fields
Field Name Description
chat - Boolean! Enable Cody chat feature.
autoComplete - Boolean! Enable Cody autocomplete feature.
commands - Boolean! Enable Cody special commands feature.
attribution - Boolean! Enable attribution search for Cody-generated snippets.
Example
{"chat": false, "autoComplete": false, "commands": false, "attribution": true}

CodyContextResult

Description

EXPERIMENTAL: A single piece of context. It's defined as a union so we can return other types of context in the future (think code intel definition or wiki page).

Types
Union Types

FileChunkContext

Example
FileChunkContext

CodyGatewayAccess

Description

Cody Gateway access granted to a subscription. FOR INTERNAL USE ONLY.

Fields
Field Name Description
enabled - Boolean! Whether or not a subscription has Cody Gateway access.
chatCompletionsRateLimit - CodyGatewayRateLimit Rate limit for chat completions access, or null if not enabled.
codeCompletionsRateLimit - CodyGatewayRateLimit Rate limit for code completions access, or null if not enabled.
embeddingsRateLimit - CodyGatewayRateLimit Rate limit for embedding text chunks, or null if not enabled.
Example
{
  "enabled": true,
  "chatCompletionsRateLimit": CodyGatewayRateLimit,
  "codeCompletionsRateLimit": CodyGatewayRateLimit,
  "embeddingsRateLimit": CodyGatewayRateLimit
}

CodyGatewayDotcomUser

Description

A dotcom user allowed to access the Cody Gateway FOR INTERNAL USE ONLY.

Fields
Field Name Description
id - ID! The id of the user
username - String! The user name of the user
codyGatewayAccess - CodyGatewayAccess! Cody Gateway access granted to this user. Properties may be inferred from dotcom site config, or be defined in overrides on the user.
Example
{
  "id": "4",
  "username": "xyz789",
  "codyGatewayAccess": CodyGatewayAccess
}

CodyGatewayRateLimit

Description

Cody Gateway access rate limits for a subscription. FOR INTERNAL USE ONLY.

Fields
Field Name Description
source - CodyGatewayRateLimitSource! The source of the rate limit configuration.
allowedModels - [String!]!

The models that are allowed for this rate limit bucket. Usually, customers will have two separate rate limits, one for chat completions and one for code completions. A usual config could include:

chatCompletionsRateLimit: {
    allowedModels: [anthropic/claude-v1, anthropic/claude-v1.3]
},
codeCompletionsRateLimit: {
    allowedModels: [anthropic/claude-instant-v1]
}

In general, the model names are of the format "$PROVIDER/$MODEL_NAME".

limit - BigInt! Requests per time interval.
intervalSeconds - Int! Interval for rate limiting.
usage - [CodyGatewayUsageDatapoint!]! Recent usage data of Cody Gateway for the subscription.
Example
{
  "source": "OVERRIDE",
  "allowedModels": ["xyz789"],
  "limit": {},
  "intervalSeconds": 123,
  "usage": [CodyGatewayUsageDatapoint]
}

CodyGatewayRateLimitSource

Description

The source of the rate limit returned. FOR INTERNAL USE ONLY.

Values
Enum Value Description

OVERRIDE

Indicates that a custom override for the rate limit has been stored.

PLAN

Indicates that the rate limit is inferred by the subscriptions active plan.
Example
"OVERRIDE"

CodyGatewayRateLimitStatus

Description

CodyGatewayRateLimitStatus current status of a rate limit.

Fields
Field Name Description
feature - String! The feature that the rate limit applies to.
limit - BigInt! The limit allowed.
usage - BigInt! The number of usages in current period.
percentUsed - Int! The percentage of the rate limit used.
interval - String! The time interval for the rate limit.
nextLimitReset - DateTime When the rate limit next resets if an interval has already started.
Example
{
  "feature": "xyz789",
  "limit": {},
  "usage": {},
  "percentUsed": 987,
  "interval": "abc123",
  "nextLimitReset": "2007-12-03T10:15:30Z"
}

CodyGatewayUsageDatapoint

Description

A usage data point of Cody Gateway usage of a subscription.

Fields
Field Name Description
date - DateTime! The day the usage occurred.
count - BigInt! The number of requests made.
model - String! The model that was used.
Example
{
  "date": "2007-12-03T10:15:30Z",
  "count": {},
  "model": "abc123"
}

CodyLLMConfiguration

Description

Cody LLM configuration contains information about how the main LLM used by Cody is configured.

Fields
Field Name Description
chatModel - String! Name of the model being used for chat.
chatModelMaxTokens - Int Maximum number of tokens client should use when talking to the chatModel.
fastChatModel - String! Name of the model being used for fast chat.
fastChatModelMaxTokens - Int Maximum number of tokens client should use when talking to the fastChatModel.
completionModel - String! Name of the model being used for code completions.
completionModelMaxTokens - Int Maximum number of tokens client should use when talking to the completionModel.
provider - String! Name of the provider being used for LLM interactions.
Example
{
  "chatModel": "abc123",
  "chatModelMaxTokens": 987,
  "fastChatModel": "abc123",
  "fastChatModelMaxTokens": 123,
  "completionModel": "abc123",
  "completionModelMaxTokens": 123,
  "provider": "xyz789"
}

CodySubscription

Description

A subscription for cody.

Fields
Field Name Description
status - CodySubscriptionStatus! The status for cody subscription.
plan - CodySubscriptionPlan! The plan for cody subscription.
applyProRateLimits - Boolean! Whether pro rate limits are applied for the user.
currentPeriodStartAt - DateTime! The current billing period start time.
currentPeriodEndAt - DateTime! The current billing period end time. This may be in the past if the subscription is in a canceled state.
cancelAtPeriodEnd - Boolean! Whether the subscription will be canceled at the end of the current billing period. (Or automatically renew, if true.)
Example
{
  "status": "ACTIVE",
  "plan": "FREE",
  "applyProRateLimits": true,
  "currentPeriodStartAt": "2007-12-03T10:15:30Z",
  "currentPeriodEndAt": "2007-12-03T10:15:30Z",
  "cancelAtPeriodEnd": true
}

CodySubscriptionPlan

Description

A plan for cody subscription.

Values
Enum Value Description

FREE

PRO

Example
"FREE"

CodySubscriptionStatus

Description

A status for cody subscription.

Values
Enum Value Description

ACTIVE

PAST_DUE

UNPAID

CANCELED

TRIALING

PENDING

OTHER

Example
"ACTIVE"

CommitSearchResult

Description

A search result that is a Git commit.

Fields
Field Name Description
label - Markdown! A markdown string that is rendered prominently.
url - String! The URL of the result.
detail - Markdown! A markdown string of that is rendered less prominently.
matches - [SearchResultMatch!]! The result previews of the result.
commit - GitCommit! The commit that matched the search query.
refs - [GitRef!]! The ref names of the commit.
sourceRefs - [GitRef!]! The refs by which this commit was reached.
messagePreview - HighlightedString The matching portion of the commit message, if any.
diffPreview - HighlightedString The matching portion of the diff, if any.
Example
{
  "label": Markdown,
  "url": "abc123",
  "detail": Markdown,
  "matches": [SearchResultMatch],
  "commit": GitCommit,
  "refs": [GitRef],
  "sourceRefs": [GitRef],
  "messagePreview": HighlightedString,
  "diffPreview": HighlightedString
}

CommitSigningConfiguration

Description

Commit signing configuration for a code host, e.g. GitHubApp or SSHKey. Today, the only supported form of commit signing is via a GitHub App.

Types
Union Types

GitHubApp

Example
GitHubApp

CommitVerification

Description

Commit signing verification for a code host, e.g. if it was signed via GitHub App or an SSH key.

Types
Union Types

GitHubCommitVerification

Example
GitHubCommitVerification

CompletionsInput

Description

Input wrapper for completions

Fields
Input Field Description
messages - [Message!]! List of conversation messages
temperature - Float! Temperature for sampling - higher means more random completions
maxTokensToSample - Int! Maximum number of tokens to sample
topK - Int! Number of highest probability completions to return
topP - Int! Probability threshold for inclusion in results
Example
{
  "messages": [Message],
  "temperature": 123.45,
  "maxTokensToSample": 987,
  "topK": 123,
  "topP": 987
}

ComputeEnvironmentEntry

Description

An entry in match environment is a variable with a value spanning a range. Variable names correspond to a variable names in a pattern metasyntax. For regular expression patterns, named capture groups will use the variable specified. For unnamed capture groups, variable names correspond to capture '1', '2', etc.

Fields
Field Name Description
variable - String! The variable name.
value - String! The value associated with this variable.
range - Range! The absolute range spanned by this value in the input.
Example
{
  "variable": "xyz789",
  "value": "xyz789",
  "range": Range
}

ComputeMatch

Description

Represents a value matched within file content, and an environment of submatches within this value corresponding to an input pattern (e.g., regular expression capture groups).

Fields
Field Name Description
value - String! The string value
range - Range! The range of this value within the file.
environment - [ComputeEnvironmentEntry]! The environment of submatches within value.
Example
{
  "value": "abc123",
  "range": Range,
  "environment": [ComputeEnvironmentEntry]
}

ComputeMatchContext

Description

The result of matching data that satisfy a search pattern, including an environment of submatches.

Fields
Field Name Description
repository - Repository! The repository.
commit - String! The commit.
path - String! The file path.
matches - [ComputeMatch]! Computed match results
Example
{
  "repository": Repository,
  "commit": "xyz789",
  "path": "abc123",
  "matches": [ComputeMatch]
}

ComputeResult

Description

A compute operation result.

Types
Union Types

ComputeMatchContext

ComputeText

Example
ComputeMatchContext

ComputeText

Description

A general computed result for arbitrary textual data. A result optionally specifies a related repository, commit, file path, or the kind of textual data.

Fields
Field Name Description
repository - Repository The repository.
commit - String The commit.
path - String The file path.
kind - String An arbitrary label communicating the kind of data the value represents.
value - String! The computed value.
Example
{
  "repository": Repository,
  "commit": "xyz789",
  "path": "xyz789",
  "kind": "xyz789",
  "value": "abc123"
}

Configuration

Description

DEPRECATED: Use the contents field on the parent type instead. This type will be removed in a future release.

Fields
Field Name Description
contents - JSONCString! DEPRECATED: This field will be removed in a future release. The raw JSON contents, encoded as a string. use the contents field on the parent type instead
messages - [String!]! DEPRECATED: This field is always empty. It will be removed in a future release. use client-side JSON Schema validation instead
Example
{
  "contents": JSONCString,
  "messages": ["xyz789"]
}

ConfigurationCascade

Description

DEPRECATED: Renamed to SettingsCascade.

Fields
Field Name Description
subjects - [SettingsSubject!]! DEPRECATED use SettingsCascade.subjects instead
merged - Configuration! DEPRECATED use SettingsCascade.final instead
Example
{
  "subjects": [SettingsSubject],
  "merged": Configuration
}

ConfigurationEdit

Description

DEPRECATED: This type was renamed to SettingsEdit. NOTE: GraphQL does not support @deprecated directives on INPUT_FIELD_DEFINITION (input fields).

Fields
Input Field Description
keyPath - [KeyPathSegment!]! DEPRECATED
value - JSONValue DEPRECATED
valueIsJSONCEncodedString - Boolean DEPRECATED. Default = false
Example
{
  "keyPath": [KeyPathSegment],
  "value": JSONValue,
  "valueIsJSONCEncodedString": false
}

Connection

Description

An object with totalCount and PageInfo.

Fields
Field Name Description
totalCount - Int! The total count of items in the connection.
pageInfo - ConnectionPageInfo! The pagination info for the connection.
Example
{"totalCount": 123, "pageInfo": ConnectionPageInfo}

ConnectionPageInfo

Description

Pagination information.

Fields
Field Name Description
endCursor - String When paginating forwards, the cursor to continue.
hasNextPage - Boolean! When paginating forwards, are there more items?
startCursor - String When paginating backward, the cursor to continue.
hasPreviousPage - Boolean! When paginating backward, are there more items?
Example
{
  "endCursor": "xyz789",
  "hasNextPage": true,
  "startCursor": "xyz789",
  "hasPreviousPage": false
}

CreateAccessTokenResult

Description

The result for Mutation.createAccessToken.

Fields
Field Name Description
id - ID! The ID of the newly created access token.
token - String! The secret token value that is used to authenticate API clients. The caller is responsible for storing this value.
Example
{
  "id": "4",
  "token": "xyz789"
}

CreateFileBlockInput

Description

CreateFileBlockInput contains the information necessary to create a file block.

Fields
Input Field Description
repositoryName - String! Name of the repository, e.g. "github.com/sourcegraph/sourcegraph".
filePath - String! Path within the repository, e.g. "client/web/file.tsx".
revision - String An optional revision, e.g. "pr/feature-1", "a9505a2947d3df53558e8c88ff8bcef390fc4e3e". If omitted, we use the latest revision (HEAD).
lineRange - CreateFileBlockLineRangeInput An optional line range. If omitted, we display the entire file.
Example
{
  "repositoryName": "abc123",
  "filePath": "abc123",
  "revision": "abc123",
  "lineRange": CreateFileBlockLineRangeInput
}

CreateFileBlockLineRangeInput

Description

Input to create a line range for a file block.

Fields
Input Field Description
startLine - Int! The first line to fetch (0-indexed, inclusive).
endLine - Int! The last line to fetch (0-indexed, exclusive).
Example
{"startLine": 987, "endLine": 123}

CreateInsightsDashboardInput

Description

Input object for creating a new dashboard.

Fields
Input Field Description
title - String! Dashboard title.
grants - InsightsPermissionGrantsInput! Permissions to grant to the dashboard.
Example
{
  "title": "xyz789",
  "grants": InsightsPermissionGrantsInput
}

CreateNotebookBlockInput

Description

GraphQL does not accept union types as inputs, so we have to use all possible optional inputs with an enum to select the actual block input we want to use.

Fields
Input Field Description
id - String! ID of the block.
type - NotebookBlockType! Block type.
markdownInput - String Markdown input.
queryInput - String Query input.
fileInput - CreateFileBlockInput File input.
symbolInput - CreateSymbolBlockInput Symbol input.
Example
{
  "id": "xyz789",
  "type": "MARKDOWN",
  "markdownInput": "abc123",
  "queryInput": "abc123",
  "fileInput": CreateFileBlockInput,
  "symbolInput": CreateSymbolBlockInput
}

CreateSymbolBlockInput

Description

CreateSymbolBlockInput contains the information necessary to create a symbol block.

Fields
Input Field Description
repositoryName - String! Name of the repository, e.g. "github.com/sourcegraph/sourcegraph".
filePath - String! Path within the repository, e.g. "client/web/file.tsx".
revision - String An optional revision, e.g. "pr/feature-1", "a9505a2947d3df53558e8c88ff8bcef390fc4e3e". If omitted, we use the latest revision (HEAD).
lineContext - Int! Number of lines to show before and after the matched symbol line.
symbolName - String! The symbol name.
symbolContainerName - String! Name of the symbol container.
symbolKind - SymbolKind! The symbol kind.
Example
{
  "repositoryName": "xyz789",
  "filePath": "abc123",
  "revision": "abc123",
  "lineContext": 987,
  "symbolName": "abc123",
  "symbolContainerName": "xyz789",
  "symbolKind": "UNKNOWN"
}

CreateUserResult

Description

The result for Mutation.createUser.

Fields
Field Name Description
user - User! The new user.
resetPasswordURL - String

The reset password URL that the new user must visit to sign into their account. If the builtin username-password authentication provider is not enabled, this field's value is null.

If email sending (SMTP) is configured on this instance and an email was provided, an email containing this URL will also be sent to the primary email address associated with the user.

Example
{
  "user": User,
  "resetPasswordURL": "abc123"
}

DateTime

Description

An RFC 3339-encoded UTC date string, such as 1973-11-29T21:33:09Z. This value can be parsed into a JavaScript Date using Date.parse. To produce this value from a JavaScript Date instance, use Date#toISOString.

Example
"2007-12-03T10:15:30Z"

DefaultSettings

Description

The default settings for the Sourcegraph instance. This is hardcoded in Sourcegraph, but may change from release to release.

Fields
Field Name Description
id - ID! The opaque GraphQL ID.
latestSettings - Settings The latest default settings (this never changes).
settingsURL - String The URL to the default settings. This URL does not exist because you cannot edit or directly view default settings.
viewerCanAdminister - Boolean! Whether the viewer can modify the subject's settings. Always false for default settings.
settingsCascade - SettingsCascade! The default settings, and the final merged settings. All viewers can access this field.
configurationCascade - ConfigurationCascade! DEPRECATED Use settingsCascade instead. This field is a deprecated alias for it and will be removed in a future release.
Example
{
  "id": 4,
  "latestSettings": Settings,
  "settingsURL": "xyz789",
  "viewerCanAdminister": false,
  "settingsCascade": SettingsCascade,
  "configurationCascade": ConfigurationCascade
}

DeleteCodeownersFilesInput

Description

A repository to pass to the deleteCodeownersFiles mutation. Either repoID or repoName must be provided.

Fields
Input Field Description
repoID - ID The repo ID to ingest the file for. Cannot be set with repositoryName.
repoName - String The repo name to ingest the file for. Cannot be set with repositoryID.
Example
{
  "repoID": "4",
  "repoName": "abc123"
}

DiffHunkLineType

Description

The type of content in a hunk line.

Values
Enum Value Description

ADDED

Added line.

UNCHANGED

Unchanged line.

DELETED

Deleted line.
Example
"ADDED"

DiffStat

Description

Statistics about a diff.

Fields
Field Name Description
added - Int! Number of lines added.
deleted - Int! Number of lines deleted.
Example
{"added": 987, "deleted": 123}

DotcomMutation

Description

Mutations that are only used on Sourcegraph.com. FOR INTERNAL USE ONLY.

Fields
Field Name Description
createProductSubscription - ProductSubscription! Creates new product subscription for an account. Only Sourcegraph.com site admins may perform this mutation. FOR INTERNAL USE ONLY.
Arguments
accountID - ID!

The ID of the user (i.e., customer) to whom this product subscription is assigned.

generateProductLicenseForSubscription - ProductLicense! Generates and signs a new product license and associates it with an existing product subscription. The product license key is signed with Sourcegraph.com's private key and is verifiable with the corresponding public key. Only Sourcegraph.com site admins may perform this mutation. FOR INTERNAL USE ONLY.
Arguments
productSubscriptionID - ID!

The product subscription to associate with the license.

license - ProductLicenseInput!

The license to generate.

revokeLicense - EmptyResponse! Revokes an existing product license, rendering it invalid.
Arguments
id - ID!

The UUID of the license to revoke

reason - String!

Reason for revoking of the license

updateProductSubscription - EmptyResponse!

Applies a partial update to a product subscription.

Only Sourcegraph.com site admins may perform this mutation. FOR INTERNAL USE ONLY.

Arguments
id - ID!

The product subscription ID to update.

update - UpdateProductSubscriptionInput!

Partial update to apply.

archiveProductSubscription - EmptyResponse! Archives an existing product subscription. Only Sourcegraph.com site admins may perform this mutation. FOR INTERNAL USE ONLY.
Arguments
id - ID!

The product subscription to archive.

Example
{
  "createProductSubscription": ProductSubscription,
  "generateProductLicenseForSubscription": ProductLicense,
  "revokeLicense": EmptyResponse,
  "updateProductSubscription": EmptyResponse,
  "archiveProductSubscription": EmptyResponse
}

DotcomQuery

Description

Mutations that are only used on Sourcegraph.com. FOR INTERNAL USE ONLY.

Fields
Field Name Description
productSubscription - ProductSubscription! The product subscription with the given UUID. An error is returned if no such product subscription exists. Only Sourcegraph.com site admins and the account owners of the product subscription may perform this query. FOR INTERNAL USE ONLY.
Arguments
uuid - String!
productSubscriptionByAccessToken - ProductSubscription!

The access available to the product subscription with the given access token. The returned ProductSubscription may be archived or not associated with an active license.

Only Sourcegraph.com site admins, the account owners of the product subscription, and specific service accounts may perform this query. FOR INTERNAL USE ONLY.

Arguments
accessToken - String!
productSubscriptions - ProductSubscriptionConnection! A list of product subscriptions. FOR INTERNAL USE ONLY.
Arguments
first - Int

Returns the first n product subscriptions from the list.

account - ID

Returns only product subscriptions for the given account. Only Sourcegraph.com site admins may perform this query with account == null.

query - String

Returns product subscriptions from users with usernames or email addresses that match the query.

productLicenses - ProductLicenseConnection! A list of product licenses. Only Sourcegraph.com site admins may perform this query. FOR INTERNAL USE ONLY.
Arguments
first - Int

Returns the first n product subscriptions from the list.

licenseKeySubstring - String

Returns only product subscriptions whose license key contains this substring.

productSubscriptionID - ID

Returns only product licenses associated with the given subscription

codyGatewayDotcomUserByToken - CodyGatewayDotcomUser A dotcom user for purposes of connecting to the Cody Gateway. Only Sourcegraph.com site admins or service accounts may perform this query. Token is a Cody Gateway token, not a Sourcegraph instance access token. FOR INTERNAL USE ONLY.
Arguments
token - String!
Example
{
  "productSubscription": ProductSubscription,
  "productSubscriptionByAccessToken": ProductSubscription,
  "productSubscriptions": ProductSubscriptionConnection,
  "productLicenses": ProductLicenseConnection,
  "codyGatewayDotcomUserByToken": CodyGatewayDotcomUser
}

EmbeddingsSearchResult

Description

A single embeddings search result.

Fields
Field Name Description
repoName - String! The name of the repository containing the search result.
revision - String! The commitID of the repository containing the search result.
fileName - String! The search result file name.
startLine - Int! The start line of the content (inclusive).
endLine - Int! The end line of the content (exclusive).
content - String! The content of the file from start line to end line.
Example
{
  "repoName": "abc123",
  "revision": "xyz789",
  "fileName": "xyz789",
  "startLine": 987,
  "endLine": 987,
  "content": "abc123"
}

EmbeddingsSearchResults

Description

Embeddings search results. Contains a list of code results and a list of text results.

Fields
Field Name Description
codeResults - [EmbeddingsSearchResult!]! A list of code file results.
textResults - [EmbeddingsSearchResult!]! A list of text file results.
Example
{
  "codeResults": [EmbeddingsSearchResult],
  "textResults": [EmbeddingsSearchResult]
}

EmptyResponse

Description

Represents a null return value.

Fields
Field Name Description
alwaysNil - String A dummy null value.
Example
{"alwaysNil": "xyz789"}

EvaluatedFeatureFlag

Description

An evaluated feature flag is any feature flag (static or random) that has been evaluated to a concrete value for a given viewer.

Fields
Field Name Description
name - String! The name of the feature flag
value - Boolean! The concrete evaluated value of the feature flag
Example
{"name": "xyz789", "value": false}

Event

Description

A description of a user event.

Fields
Input Field Description
event - String! The name of the event.
userCookieID - String! The randomly generated unique user ID stored in a browser cookie.
firstSourceURL - String The first sourcegraph URL visited by the user, stored in a browser cookie.
lastSourceURL - String The last sourcegraph URL visited by the user, stored in a browser cookie.
url - String! The URL when the event was logged.
source - EventSource! The source of the event.
cohortID - String An optional cohort ID to identify the user as part of a specific A/B test. The cohort ID is expected to be a date in the form YYYY-MM-DD
referrer - String An optional referrer parameter for the user's current session. Only captured and stored on Sourcegraph Cloud.
originalReferrer - String The original referrer for a user
sessionReferrer - String The session referrer for a user
sessionFirstURL - String The sessions first url for a user
deviceSessionID - String Device session ID to identify the user's session for analytics.
argument - String The additional argument information.
publicArgument - String Public argument information. PRIVACY: Do NOT include any potentially private information in this field. These properties get sent to our analytics tools for Cloud, so must not include private information, such as search queries or repository names.
deviceID - String Device ID used for Amplitude analytics. Used on Sourcegraph Cloud only.
eventID - Int Event ID used to deduplicate events that occur simultaneously in Amplitude analytics. See https://developers.amplitude.com/docs/http-api-v2#optional-keys. Used on Sourcegraph Cloud only.
insertID - String Insert ID used to deduplicate events that re-occur in the event of retries or backfills in Amplitude analytics. See https://developers.amplitude.com/docs/http-api-v2#optional-keys. Used on Sourcegraph Cloud only.
client - String The client that this event is being sent from.
billingProductCategory - String The product category for the event, used for billing purposes.
billingEventID - String The billing ID for the event, used for tagging user events for billing aggregation purposes.
connectedSiteID - String The site ID that the client was connected to when the event was logged.
hashedLicenseKey - String The connected site's license key, hashed using sha256. Used for uniquely identifying the site.
Example
{
  "event": "abc123",
  "userCookieID": "abc123",
  "firstSourceURL": "xyz789",
  "lastSourceURL": "xyz789",
  "url": "abc123",
  "source": "WEB",
  "cohortID": "abc123",
  "referrer": "abc123",
  "originalReferrer": "xyz789",
  "sessionReferrer": "abc123",
  "sessionFirstURL": "abc123",
  "deviceSessionID": "xyz789",
  "argument": "abc123",
  "publicArgument": "abc123",
  "deviceID": "xyz789",
  "eventID": 987,
  "insertID": "xyz789",
  "client": "xyz789",
  "billingProductCategory": "abc123",
  "billingEventID": "abc123",
  "connectedSiteID": "abc123",
  "hashedLicenseKey": "xyz789"
}

EventLog

Description

A single user event that has been logged.

Fields
Field Name Description
name - String! The name of the event.
user - User The user who executed the event, if one exists.
anonymousUserID - String! The randomly generated unique user ID stored in a browser cookie.
url - String! The URL when the event was logged.
source - String! The source of the event.
argument - String The additional argument information.
version - String! The Sourcegraph version when the event was logged.
timestamp - DateTime! The timestamp when the event was logged.
Example
{
  "name": "xyz789",
  "user": User,
  "anonymousUserID": "xyz789",
  "url": "xyz789",
  "source": "abc123",
  "argument": "abc123",
  "version": "xyz789",
  "timestamp": "2007-12-03T10:15:30Z"
}

EventLogsConnection

Description

A list of event logs.

Fields
Field Name Description
nodes - [EventLog!]! A list of event logs.
totalCount - Int! The total count of event logs in the connection. This total count may be larger than the number of nodes in this object when the result is paginated.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [EventLog],
  "totalCount": 987,
  "pageInfo": PageInfo
}

EventSource

Description

The product sources where events can come from.

Values
Enum Value Description

WEB

CODEHOSTINTEGRATION

BACKEND

STATICWEB

IDEEXTENSION

CODY

DEPRECATED
Example
"WEB"

ExecutionLogEntry

Description

A description of a command run inside the executor to during processing of the parent record.

Fields
Field Name Description
key - String! An internal tag used to correlate this log entry with other records.
command - [String!]! The arguments of the command run inside the executor.
startTime - DateTime! The date when this command started.
exitCode - Int The exit code of the command. Null, if the command has not finished yet.
out - String! The combined stdout and stderr logs of the command.
durationMilliseconds - Int The duration in milliseconds of the command. Null, if the command has not finished yet.
Example
{
  "key": "xyz789",
  "command": ["xyz789"],
  "startTime": "2007-12-03T10:15:30Z",
  "exitCode": 123,
  "out": "xyz789",
  "durationMilliseconds": 987
}

Executor

Description

An active executor compute instance.

Fields
Field Name Description
id - ID! The unique identifier of this executor.
hostname - String! The hostname of the executor instance.
queueName - String The queue name that the executor polls for work.
queueNames - [String!] The queue name that the executor polls for work.
active - Boolean! Active is true, if a heartbeat from the executor has been received at most three heartbeat intervals ago.
os - String! The operating system running the executor.
architecture - String! The machine architecture running the executor.
dockerVersion - String! The version of Git used by the executor.
executorVersion - String! The version of the executor.
gitVersion - String! The version of Docker used by the executor.
igniteVersion - String! The version of Ignite used by the executor.
srcCliVersion - String! The version of src-cli used by the executor.
firstSeenAt - DateTime! The first time the executor sent a heartbeat to the Sourcegraph instance.
lastSeenAt - DateTime! The last time the executor sent a heartbeat to the Sourcegraph instance.
compatibility - ExecutorCompatibility

The compatibility of the executor with respect to the Sourcegraph instance. If outdated, please make sure that the executor and the Sourcegraph backend are of compatible versions. This means they should match in major and minor version, but they may be 1 minor version apart. If too new, please update the Sourcegraph instance to match the version of the executor or downgrade the executor.

Compatibility can be null if the executor or Sourcegraph instance runs in dev mode or there's a version mismatch.

Example
{
  "id": "4",
  "hostname": "abc123",
  "queueName": "abc123",
  "queueNames": ["abc123"],
  "active": false,
  "os": "abc123",
  "architecture": "xyz789",
  "dockerVersion": "xyz789",
  "executorVersion": "abc123",
  "gitVersion": "abc123",
  "igniteVersion": "abc123",
  "srcCliVersion": "xyz789",
  "firstSeenAt": "2007-12-03T10:15:30Z",
  "lastSeenAt": "2007-12-03T10:15:30Z",
  "compatibility": "OUTDATED"
}

ExecutorCompatibility

Description

The compatibility of the executor with the sourcegraph instance.

Values
Enum Value Description

OUTDATED

Executor version is more than one version behind the Sourcegraph instance.

UP_TO_DATE

Executor is up-to-date with the Sourcegraph instance.

VERSION_AHEAD

Executor version is more than one version ahead of the Sourcegraph instance.
Example
"OUTDATED"

ExecutorConnection

Description

A list of active executors compute instances.

Fields
Field Name Description
nodes - [Executor!]! A list of executors.
totalCount - Int! The total number of executors in this result set.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [Executor],
  "totalCount": 987,
  "pageInfo": PageInfo
}

ExecutorSecret

Description

A secret to be used in executor jobs.

Fields
Field Name Description
id - ID! The unique identifier of the secret.
key - String! The key under which the secret is available. Secrets are usually exposed as environment variables named using this key. Recommended format: uppercase letters, numbers and underscores.
scope - ExecutorSecretScope! The scope of this secret. The secret will only be usable for jobs in this particular scope.
overwritesGlobalSecret - Boolean! If true, this secret is defined in a namespace and a secret with the same key is also defined in the global namespace, which this secret overwrites.
namespace - Namespace The namespace this secret belongs to. Null, if a global secret. Global secrets are available to every execution.
creator - User The creator of the secret. Null, if the creator has been deleted.
createdAt - DateTime! The date and time this secret has been created.
updatedAt - DateTime! The date and time this secret has been last updated.
accessLogs - ExecutorSecretAccessLogConnection! The list of access events to this secret. Every time the secret value is decoded and used, one of these entries is created.
Arguments
first - Int

Only return N records.

after - String

Opaque cursor for pagination.

Example
{
  "id": "4",
  "key": "abc123",
  "scope": "BATCHES",
  "overwritesGlobalSecret": true,
  "namespace": Namespace,
  "creator": User,
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z",
  "accessLogs": ExecutorSecretAccessLogConnection
}

ExecutorSecretAccessLog

Description

An access log entry for an executor secret. These are created every time the secret value is decoded.

Fields
Field Name Description
id - ID! The unique identifier of the log entry.
executorSecret - ExecutorSecret! The secret that this log entry belongs to.
user - User The user in which name the secret has been used. This is null when the access was not by a user account, or when the user account was deleted.
machineUser - String! True when the secret was accessed by an internal procedure.
createdAt - DateTime! The date and time when the secret has been used.
Example
{
  "id": 4,
  "executorSecret": ExecutorSecret,
  "user": User,
  "machineUser": "abc123",
  "createdAt": "2007-12-03T10:15:30Z"
}

ExecutorSecretAccessLogConnection

Description

A list of executor secret access logs.

Fields
Field Name Description
nodes - [ExecutorSecretAccessLog!]! A list of access logs.
totalCount - Int! The total number of records in this result set.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [ExecutorSecretAccessLog],
  "totalCount": 987,
  "pageInfo": PageInfo
}

ExecutorSecretConnection

Description

A list of executor secrets.

Fields
Field Name Description
nodes - [ExecutorSecret!]! A list of executor secrets.
totalCount - Int! The total number of records in this result set.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [ExecutorSecret],
  "totalCount": 123,
  "pageInfo": PageInfo
}

ExecutorSecretScope

Description

Enum of the possible scopes for executor secrets.

Values
Enum Value Description

BATCHES

The secret is meant to be used with Batch Changes execution.

CODEINTEL

The secret is meant to be used with Auto-indexing.
Example
"BATCHES"

ExhaustiveSearchAggregationResult

Description

Information regarding the results of an exhaustive search aggregation

Fields
Field Name Description
groups - [AggregationGroup!]! A list of the first [LIMIT] aggregation groups in decreasing order
supportsPersistence - Boolean Boolean indicating if the search query supports being persisted as an insight on a dashboard
otherResultCount - Int A count to capture the number of results that are not included in the list of groups returned. This includes result counts for groups that were excluded due to the requested limit
otherGroupCount - Int A count to represent the number of aggregation groups that were not returned due to the requested LIMIT
mode - SearchAggregationMode! The SearchAggregationMode the results relate to
Example
{
  "groups": [AggregationGroup],
  "supportsPersistence": true,
  "otherResultCount": 123,
  "otherGroupCount": 987,
  "mode": "REPO"
}

ExistingChangesetReference

Description

A reference to a changeset that already exists on a code host (and was not created by the batch change).

Fields
Field Name Description
baseRepository - Repository! The repository that contains the existing changeset on the code host.
externalID - String!

The ID that uniquely identifies the existing changeset on the code host.

For GitHub and Bitbucket Server, this is the pull request number (as a string) in the base repository. For example, "1234" for PR 1234.

Example
{
  "baseRepository": Repository,
  "externalID": "abc123"
}

ExportedEvent

Description

ExportedEvent does not implement Node for lookup because they are ephemereal.

Fields
Field Name Description
id - ID! The unique id of the event queued for export.
exportedAt - DateTime! The time this event was exported at.
payload - JSONValue! The raw event payload that was exported, rendered as JSON.
Example
{
  "id": "4",
  "exportedAt": "2007-12-03T10:15:30Z",
  "payload": JSONValue
}

ExportedEventsConnection

Description

A list of recently exported telemetry event payloads.

Fields
Field Name Description
nodes - [ExportedEvent!]! A list of exported events, with the most recent events first.
totalCount - Int! The total number of events in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [ExportedEvent],
  "totalCount": 987,
  "pageInfo": PageInfo
}

ExternalAccount

Description

An external account associated with a user.

Fields
Field Name Description
id - ID! The unique ID for the external account.
user - User! The user on Sourcegraph.
serviceType - String! The type of the external service where the external account resides.
serviceID - String! An identifier for the external service where the external account resides.
clientID - String! An identifier for the client of the external service where the external account resides. This distinguishes among multiple authentication providers that access the same service with different parameters.
accountID - String! An identifier for the external account (typically equal to or derived from the ID on the external service).
createdAt - DateTime! The creation date of this external account on Sourcegraph.
updatedAt - DateTime! The last-updated date of this external account on Sourcegraph.
refreshURL - String A URL that, when visited, re-initiates the authentication process.
accountData - JSONValue Provider-specific data about the external account. Only site admins may query this field.
publicAccountData - PublicExternalAccountData Public provider-specific data about the external account. Only users that are linked to the external account and site admins may query this field.
Example
{
  "id": "4",
  "user": User,
  "serviceType": "abc123",
  "serviceID": "xyz789",
  "clientID": "xyz789",
  "accountID": "xyz789",
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z",
  "refreshURL": "xyz789",
  "accountData": JSONValue,
  "publicAccountData": PublicExternalAccountData
}

ExternalAccountConnection

Description

A list of external accounts.

Fields
Field Name Description
nodes - [ExternalAccount!]! A list of external accounts.
totalCount - Int! The total count of external accounts in the connection. This total count may be larger than the number of nodes in this object when the result is paginated.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [ExternalAccount],
  "totalCount": 123,
  "pageInfo": PageInfo
}

ExternalChangeset

Description

A changeset on a code host (e.g., a pull request on GitHub).

Fields
Field Name Description
id - ID! The unique ID for the changeset.
externalID - String The external ID that uniquely identifies this ExternalChangeset on the code host. For example, on GitHub this is the pull request number. This is only set once the changeset is published on the code host.
repository - Repository! The repository changed by this changeset.
batchChanges - BatchChangeConnection! The batch changes that contain this changeset.
Arguments
first - Int

Returns the first n batch changes from the list.

after - String

Opaque pagination cursor.

state - BatchChangeState

Only return batch changes in this state. If states is also specified, it will take precedence over state.

states - [BatchChangeState!]

Only return batch changes in any of these states. If state is also specified, states will take precedence over it.

viewerCanAdminister - Boolean

Only include batch changes that the viewer can administer.

ownedByBatchChange - ID The batch change that "owns" this changeset: If this is null, it is imported/tracked by a batch change.
events - ChangesetEventConnection! The events belonging to this changeset.
Arguments
first - Int
after - String
createdAt - DateTime! The date and time when the changeset was created.
updatedAt - DateTime! The date and time when the changeset was updated.
nextSyncAt - DateTime The date and time when the next changeset sync is scheduled, or null if none is scheduled or when the initial sync hasn't happened.
scheduleEstimateAt - DateTime

The time the changeset is expected to be enqueued at. This is an estimate, and may change depending on other code host and Batch Changes activity.

Null if the changeset is not currently scheduled.

title - String The title of the changeset, or null if the data hasn't been synced from the code host yet.
body - String The body of the changeset, or null if the data hasn't been synced from the code host yet.
author - Person

The author of the changeset, or null if the data is unavailable or hasn't been synced from the code host yet.

Note that author is not fully supported by some code host APIs:

  • GitHub - only author.name
  • GitLab - only author.name
  • Bitbucket Server - author is not always available
  • Bitbucket Cloud - author is never available
  • Azure DevOps - author is always available
state - ChangesetState! The state of the changeset.
labels - [ChangesetLabel!]! The labels attached to the changeset on the code host.
externalURL - ExternalLink The external URL of the changeset on the code host. Not set when changeset state is UNPUBLISHED, externalState is DELETED, or the changeset's data hasn't been synced yet.
forkNamespace - String If the changeset was opened from a fork, this is the namespace of the fork (which will generally correspond to a user or organisation name on the code host).
forkName - String If the changeset was opened from a fork, this is the name of the fork repository.
commitVerification - CommitVerification Commit verification object for this changeset's commit, if it was signed.
reviewState - ChangesetReviewState

The review state of this changeset. This is only set once the changeset is published on the code host.

Note: The COMMENTED and DISMISSED review states are not yet implemented.

diff - RepositoryComparisonInterface The diff of this changeset, or null if the changeset is closed (without merging) or is already merged.
diffStat - DiffStat The diffstat of this changeset, or null if the changeset is closed (without merging) or is already merged. This data is also available indirectly through the diff field above, but if only the diffStat is required, this field is cheaper to access.
checkState - ChangesetCheckState The state of the checks (e.g., for continuous integration) on this changeset, or null if no checks have been configured.
error - String An error that has occurred when publishing or updating the changeset. This is only set when the changeset state is ERRORED and the viewer can administer this changeset.
syncerError - String An error that has occured during the last sync of the changeset. Null, if was successful.
currentSpec - VisibleChangesetSpec

The current changeset spec for this changeset. Use this to get access to the workspace execution that generated this changeset.

Null if the changeset was only imported.

Example
{
  "id": 4,
  "externalID": "xyz789",
  "repository": Repository,
  "batchChanges": BatchChangeConnection,
  "ownedByBatchChange": "4",
  "events": ChangesetEventConnection,
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z",
  "nextSyncAt": "2007-12-03T10:15:30Z",
  "scheduleEstimateAt": "2007-12-03T10:15:30Z",
  "title": "xyz789",
  "body": "abc123",
  "author": Person,
  "state": "UNPUBLISHED",
  "labels": [ChangesetLabel],
  "externalURL": ExternalLink,
  "forkNamespace": "abc123",
  "forkName": "abc123",
  "commitVerification": GitHubCommitVerification,
  "reviewState": "APPROVED",
  "diff": RepositoryComparison,
  "diffStat": DiffStat,
  "checkState": "PENDING",
  "error": "xyz789",
  "syncerError": "abc123",
  "currentSpec": VisibleChangesetSpec
}

ExternalRepository

Description

A repository on an external service (such as GitHub, GitLab, Phabricator, etc.).

Fields
Field Name Description
id - String! The repository's ID on the external service. Example: For GitHub, this is the GitHub GraphQL API's node ID for the repository.
serviceType - String! The type of external service where this repository resides. Example: "github", "gitlab", etc.
serviceID - String! The particular instance of the external service where this repository resides. Its value is opaque but typically consists of the canonical base URL to the service. Example: For GitHub.com, this is "https://github.com/".
Example
{
  "id": "xyz789",
  "serviceType": "xyz789",
  "serviceID": "abc123"
}

ExternalService

Description

A configured external service.

Fields
Field Name Description
id - ID! The external service's unique ID.
kind - ExternalServiceKind! The kind of external service.
displayName - String! The display name of the external service.
rateLimiterState - RateLimiterState The current rate limiter state for the external service.
config - JSONCString! The JSON configuration of the external service.
createdAt - DateTime! When the external service was created.
updatedAt - DateTime! When the external service was last updated.
repoCount - Int! The number of repos synced by the external service.
webhookURL - String An optional URL that will be populated when webhooks have been configured for the external service.
warning - String This is an optional field that's populated when we ran into errors on the backend side when trying to create/update an ExternalService, but the create/update still succeeded. It is a field on ExternalService instead of a separate thing in order to not break the API and stay backwards compatible.
lastSyncError - String External services are synced with code hosts in the background. This optional field will contain any errors that occurred during the most recent completed sync.
lastSyncAt - DateTime LastSyncAt is the time the last sync job was run for this code host. Null if it has never been synced so far.
nextSyncAt - DateTime The timestamp of the next sync job. Null if not scheduled for a re-sync.
creator - User The creator of this external service. Null if the user was deleted or created by a background routine.
lastUpdater - User The last updater of this external service. Null if the user was deleted or created by a background routine.
webhookLogs - WebhookLogConnection!

Returns recently received webhooks on this external service.

Only site admins may access this field.

DEPRECATED: Webhook logs linked directly to an external service will be removed. See https://docs.sourcegraph.com/admin/config/webhooks/incoming#deprecation-notice

Webhook logs linked directly to an external service will be removed. See https://docs.sourcegraph.com/admin/config/webhooks/incoming#deprecation-notice
Arguments
first - Int

Returns the first n webhook logs.

after - String

Opaque pagination cursor.

onlyErrors - Boolean

Only include webhook logs that resulted in errors.

since - DateTime

Only include webhook logs on or after this time.

until - DateTime

Only include webhook logs on or before this time.

syncJobs - ExternalServiceSyncJobConnection! The list of recent sync jobs for this external service.
Arguments
first - Int
checkConnection - ExternalServiceAvailability! Checks the availability of the external service.
hasConnectionCheck - Boolean!

True if this external service can perform availability check by running checkConnection.

If this is false, then checkConnection responds with ExternalServiceAvailabilityUnknown.

supportsRepoExclusion - Boolean! True if this external service configuration supports exclude parameter.
unrestricted - Boolean! True if this external service is unrestricted and marks all repositories added by it as publicly accessible.
Example
{
  "id": 4,
  "kind": "AWSCODECOMMIT",
  "displayName": "xyz789",
  "rateLimiterState": RateLimiterState,
  "config": JSONCString,
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z",
  "repoCount": 987,
  "webhookURL": "abc123",
  "warning": "abc123",
  "lastSyncError": "xyz789",
  "lastSyncAt": "2007-12-03T10:15:30Z",
  "nextSyncAt": "2007-12-03T10:15:30Z",
  "creator": User,
  "lastUpdater": User,
  "webhookLogs": WebhookLogConnection,
  "syncJobs": ExternalServiceSyncJobConnection,
  "checkConnection": ExternalServiceAvailable,
  "hasConnectionCheck": true,
  "supportsRepoExclusion": true,
  "unrestricted": false
}

ExternalServiceAvailability

Description

Availability status of an external service for diagnostic purposes.

This is so that the UI can surface whether the external service can serve requests, and if not, why is the reason for that.

Example
ExternalServiceAvailable

ExternalServiceAvailabilityUnknown

Description

Availability for some external services may not be determined, or only partially supported. In that case unknown variant of ExternalServiceAvailability is returned.

Fields
Field Name Description
implementationNote - String! User-friendly textual description of the implementation status of availability. This is expected to be tied to specific kinds of external services.
Example
{"implementationNote": "xyz789"}

ExternalServiceAvailable

Description

Indicator that the external service was recently found to be available.

Fields
Field Name Description
lastCheckedAt - DateTime! The timestamp of the last successful availability check that was performed.
Example
{"lastCheckedAt": "2007-12-03T10:15:30Z"}

ExternalServiceConnection

Description

A list of external services.

Fields
Field Name Description
nodes - [ExternalService!]! A list of external services.
totalCount - Int! The total number of external services in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [ExternalService],
  "totalCount": 987,
  "pageInfo": PageInfo
}

ExternalServiceKind

Description

A specific kind of external service.

Values
Enum Value Description

AWSCODECOMMIT

AZUREDEVOPS

BITBUCKETCLOUD

BITBUCKETSERVER

GERRIT

GITHUB

GITLAB

GITOLITE

GOMODULES

JVMPACKAGES

NPMPACKAGES

OTHER

PAGURE

PERFORCE

PHABRICATOR

PYTHONPACKAGES

RUSTPACKAGES

RUBYPACKAGES

Example
"AWSCODECOMMIT"

ExternalServiceNamespace

Description

A namespace sourced from a defined external service (such as GitHub, GitLab, Phabricator, etc.) that can be discovered before any sync or mirror operations.

Fields
Field Name Description
id - ID! The unique identifier of the external service namespace.
name - String! The name of the external service namespace.
externalID - String! The Namespace's ID on the external service. Example: For GitHub, this is the GitHub GraphQL API's node ID for the organization.
Example
{
  "id": 4,
  "name": "xyz789",
  "externalID": "xyz789"
}

ExternalServiceNamespaceConnection

Description

A list of namespaces available to an external service configuration.

Fields
Field Name Description
nodes - [ExternalServiceNamespace!]! A list of namespaces available on the source. Namespaces are used to organize which members and users can access repositories and are defined by external service kind (e.g. Github organizations, Bitbucket projects, etc.)
totalCount - Int! The total number of source repos in the connection.
Example
{"nodes": [ExternalServiceNamespace], "totalCount": 987}

ExternalServiceRepository

Description

A repository sourced from a defined external service (such as GitHub, GitLab, Phabricator, etc.) that can be discovered before any sync or mirror operations.

Fields
Field Name Description
id - ID! The unique identifier of the external service repository.
name - String! The name of the external service repository.
externalID - String! The repository's ID on the external service. Example: For GitHub, this is the GitHub GraphQL API's node ID for the repository.
Example
{
  "id": 4,
  "name": "abc123",
  "externalID": "abc123"
}

ExternalServiceRepositoryConnection

Description

A list of repositories available to an external service configuration.

Fields
Field Name Description
nodes - [ExternalServiceRepository!]! A list of repositories available on the source.
Example
{"nodes": [ExternalServiceRepository]}

ExternalServiceSyncError

Description

FOR INTERNAL USE ONLY: A status message produced when repositories could not be synced from an external service

Fields
Field Name Description
message - String! The message of this status message
externalService - ExternalService! The external service that failed to sync
Example
{
  "message": "abc123",
  "externalService": ExternalService
}

ExternalServiceSyncJob

Description

An external service sync job represents one sync with the code host. It's a background job that will eventually be run by the repo syncer.

Fields
Field Name Description
id - ID! The unique identifier of the sync job.
state - ExternalServiceSyncJobState! The current state of the sync job.
queuedAt - DateTime! When the sync job was added to the queue.
startedAt - DateTime Set when sync begins.
finishedAt - DateTime Set when sync finished.
failureMessage - String Error message, if the sync failed.
reposSynced - Int! The number of repos synced during this sync job.
repoSyncErrors - Int! The number of times an error occurred syncing a repo during this sync job.
reposAdded - Int! The number of new repos discovered during this sync job.
reposDeleted - Int! The number of repos deleted as a result of this sync job.
reposModified - Int! The number of existing repos whose metadata has changed during this sync job.
reposUnmodified - Int! The number of existing repos whose metadata did not change during this sync job.
Example
{
  "id": 4,
  "state": "QUEUED",
  "queuedAt": "2007-12-03T10:15:30Z",
  "startedAt": "2007-12-03T10:15:30Z",
  "finishedAt": "2007-12-03T10:15:30Z",
  "failureMessage": "abc123",
  "reposSynced": 987,
  "repoSyncErrors": 987,
  "reposAdded": 123,
  "reposDeleted": 123,
  "reposModified": 987,
  "reposUnmodified": 123
}

ExternalServiceSyncJobConnection

Description

A list of external service sync jobs.

Fields
Field Name Description
nodes - [ExternalServiceSyncJob!]! A list of sync jobs.
totalCount - Int! The total number of jobs in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [ExternalServiceSyncJob],
  "totalCount": 987,
  "pageInfo": PageInfo
}

ExternalServiceSyncJobState

Description

The possible states of an external service sync job.

Values
Enum Value Description

QUEUED

Not yet started. Will be picked up by a worker eventually.

PROCESSING

Currently syncing.

ERRORED

An error occurred while syncing. Will be retried eventually.

FAILED

A fatal error occurred while syncing. No retries will be made.

COMPLETED

Sync finished successfully.

CANCELING

Sync job is being canceled.

CANCELED

Sync job has been canceled.
Example
"QUEUED"

ExternalServiceUnavailable

Description

Indicator that the external service was recently not found available.

Fields
Field Name Description
suspectedReason - String! User-friendly textual description of supposed reason why the service is not available.
Example
{"suspectedReason": "xyz789"}

FeatureFlag

Description

A feature flag is either a static boolean feature flag or a rollout feature flag

Example
FeatureFlagBoolean

FeatureFlagBoolean

Description

A feature flag that has a statically configured value

Fields
Field Name Description
name - String! The name of the feature flag
value - Boolean! The static value of the feature flag
overrides - [FeatureFlagOverride!]! Overrides that apply to the feature flag
createdAt - DateTime! When the feature flag was created.
updatedAt - DateTime! When the feature flag was last updated.
Example
{
  "name": "abc123",
  "value": true,
  "overrides": [FeatureFlagOverride],
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z"
}

FeatureFlagOverride

Description

A feature flag override is an override of a feature flag's value for a specific org or user

Fields
Field Name Description
id - ID! A unique ID for this feature flag override
namespace - Namespace! The namespace for this override. Will always be a user or org.
targetFlag - FeatureFlag! The name of the feature flag being overridden
value - Boolean! The overridden value of the feature flag
Example
{
  "id": "4",
  "namespace": Namespace,
  "targetFlag": FeatureFlagBoolean,
  "value": false
}

FeatureFlagRollout

Description

A feature flag that is randomly evaluated to a boolean based on the rollout parameter

Fields
Field Name Description
name - String! The name of the feature flag
rolloutBasisPoints - Int! The ratio of users that will be assigned this this feature flag, expressed in basis points (0.01%).
overrides - [FeatureFlagOverride!]! Overrides that apply to the feature flag
createdAt - DateTime! When the feature flag was created.
updatedAt - DateTime! When the feature flag was last updated.
Example
{
  "name": "abc123",
  "rolloutBasisPoints": 987,
  "overrides": [FeatureFlagOverride],
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z"
}

File

Description

File is temporarily preserved for backcompat with browser extension search API client code.

Fields
Field Name Description
path - String! The full path (relative to the repository root) of this file.
name - String! The base name (i.e., file name only) of this file's path.
isDirectory - Boolean! Whether this is a directory.
url - String! The URL to this file on Sourcegraph.
repository - Repository! The repository that contains this file.
Example
{
  "path": "xyz789",
  "name": "xyz789",
  "isDirectory": false,
  "url": "abc123",
  "repository": Repository
}

File2

Description

A file. In a future version of Sourcegraph, a repository's files may be distinct from a repository's blobs (for example, to support searching/browsing generated files that aren't committed and don't exist as Git blobs). Clients should generally use the GitBlob concrete type and GitCommit.blobs (not GitCommit.files), unless they explicitly want to opt-in to different behavior in the future. INTERNAL: This is temporarily named File2 during a migration. Do not refer to the name File2 in any API clients as the name will change soon.

Fields
Field Name Description
path - String! The full path (relative to the root) of this file.
name - String! The base name (i.e., file name only) of this file.
isDirectory - Boolean! False because this is a file, not a directory.
content - String! The content of this file.
Arguments
startLine - Int

Return file content starting at line "startLine". A value <= 0 will be the start of the file.

endLine - Int

Return file content ending at line "endLine". A value < 0 or > totalLines will set endLine to the end of the file.

byteSize - Int! The file size in bytes.
totalLines - Int! Total line count for the file. Returns 0 for binary files.
binary - Boolean! Whether or not it is binary.
richHTML - String! The file rendered as rich HTML, or an empty string if it is not a supported rich file type. This HTML string is already escaped and thus is always safe to render.
Arguments
startLine - Int

Return richHTML content starting at line "startLine". A value <= 0 will be the start of the file.

endLine - Int

Return richHTML content ending at line "endLine". A value < 0 or > totalLines will set endLine to the end of the file.

url - String! The URL to this file (using the input revision specifier, which may not be immutable).
canonicalURL - String! The canonical URL to this file (using an immutable revision specifier).
changelistURL - String The URL to this file using the changelist ID if this file is inside a perforce depot.
externalURLs - [ExternalLink!]! The URLs to this file on external services.
highlight - HighlightedFile! Highlight the file.
Arguments
disableTimeout - Boolean!
highlightLongLines - Boolean

If highlightLongLines is true, lines which are longer than 2000 bytes are highlighted. 2000 bytes is enabled. This may produce a significant amount of HTML which some browsers (such as Chrome, but not Firefox) may have trouble rendering efficiently.

format - HighlightResponseFormat

Specifies which format/highlighting technique to use.

startLine - Int

Return highlight content starting at line "startLine". A value <= 0 will be the start of the file. Warning: Pagination only works with the HTML_PLAINTEXT format type at the moment.

endLine - Int

Return blob highlight ending at line "endLine". A value < 0 or > totalLines will set endLine to the end of the file. Warning: Pagination only works with the HTML_PLAINTEXT format type at the moment.

languages - [String!]!

The language(s) determined based on the file's name and contents.

The resulting array may be empty if no language could be determined, or it may have multiple entries if the language is ambiguous.

If there are multiple entries, they will be sorted in descending order of likelihood.

Possible Types
File2 Types

VirtualFile

GitBlob

BatchSpecWorkspaceFile

Example
{
  "path": "abc123",
  "name": "abc123",
  "isDirectory": true,
  "content": "abc123",
  "byteSize": 987,
  "totalLines": 123,
  "binary": false,
  "richHTML": "xyz789",
  "url": "abc123",
  "canonicalURL": "abc123",
  "changelistURL": "abc123",
  "externalURLs": [ExternalLink],
  "highlight": HighlightedFile,
  "languages": ["xyz789"]
}

FileBlock

Description

FileBlock specifies a file (or part of a file) to display within the block.

Fields
Field Name Description
id - String! ID of the block.
fileInput - FileBlockInput! File block input.
Example
{
  "id": "xyz789",
  "fileInput": FileBlockInput
}

FileBlockInput

Description

FileBlockInput contains the information necessary to fetch the file.

Fields
Field Name Description
repositoryName - String! Name of the repository, e.g. "github.com/sourcegraph/sourcegraph".
filePath - String! Path within the repository, e.g. "client/web/file.tsx".
revision - String An optional revision, e.g. "pr/feature-1", "a9505a2947d3df53558e8c88ff8bcef390fc4e3e". If omitted, we use the latest revision (HEAD).
lineRange - FileBlockLineRange An optional line range. If omitted, we display the entire file.
Example
{
  "repositoryName": "abc123",
  "filePath": "xyz789",
  "revision": "abc123",
  "lineRange": FileBlockLineRange
}

FileBlockLineRange

Description

A line range inside a file.

Fields
Field Name Description
startLine - Int! The first line to fetch (0-indexed, inclusive).
endLine - Int! The last line to fetch (0-indexed, exclusive).
Example
{"startLine": 123, "endLine": 987}

FileChunkContext

Description

A piece of context that represents a chunk of a file in a git repository

Fields
Field Name Description
blob - GitBlob! The git blob this file is associated with
startLine - Int! The start line of the relevant chunk (inclusive).
endLine - Int! The end line of the relevant chunk (exclusive).
chunkContent - String! The relevant content of the file from start line to end line.
Example
{
  "blob": GitBlob,
  "startLine": 987,
  "endLine": 987,
  "chunkContent": "xyz789"
}

FileDiff

Description

A diff for a single file.

Fields
Field Name Description
oldPath - String The old (original) path of the file, or null if the file was added.
oldFile - File2 The old file, or null if the file was created (oldFile.path == oldPath).
newPath - String The new (changed) path of the file, or null if the file was deleted.
newFile - File2 The new file, or null if the file was deleted (newFile.path == newPath).
mostRelevantFile - File2! The old file (if the file was deleted) and otherwise the new file. This file field is typically used by clients that want to show a "View" link to the file.
hunks - [FileDiffHunk!]! Hunks that were changed from old to new.
stat - DiffStat! The diff stat for the whole file.
internalID - String! FOR INTERNAL USE ONLY. An identifier for the file diff that is unique among all other file diffs in the list that contains it.
Example
{
  "oldPath": "xyz789",
  "oldFile": File2,
  "newPath": "xyz789",
  "newFile": File2,
  "mostRelevantFile": File2,
  "hunks": [FileDiffHunk],
  "stat": DiffStat,
  "internalID": "xyz789"
}

FileDiffConnection

Description

A list of file diffs.

Fields
Field Name Description
nodes - [FileDiff!]! A list of file diffs.
totalCount - Int The total count of file diffs in the connection, if available. This total count may be larger than the number of nodes in this object when the result is paginated.
pageInfo - PageInfo! Pagination information.
diffStat - DiffStat! The diff stat for the file diffs in this object, which may be a subset of the entire diff if the result is paginated.
rawDiff - String! The raw diff for the file diffs in this object, which may be a subset of the entire diff if the result is paginated.
Example
{
  "nodes": [FileDiff],
  "totalCount": 123,
  "pageInfo": PageInfo,
  "diffStat": DiffStat,
  "rawDiff": "xyz789"
}

FileDiffHunk

Description

A changed region ("hunk") in a file diff.

Fields
Field Name Description
oldRange - FileDiffHunkRange! The range of the old file that the hunk applies to.
oldNoNewlineAt - Boolean! Whether the old file had a trailing newline.
newRange - FileDiffHunkRange! The range of the new file that the hunk applies to.
section - String The diff hunk section heading, if any.
body - String! The hunk body, with lines prefixed with '-', '+', or ' '.
highlight - HighlightedDiffHunkBody! Highlight the hunk.
Arguments
disableTimeout - Boolean!
highlightLongLines - Boolean

If highlightLongLines is true, lines which are longer than 2000 bytes are highlighted. 2000 bytes is enabled. This may produce a significant amount of HTML which some browsers (such as Chrome, but not Firefox) may have trouble rendering efficiently.

format - HighlightResponseFormat

Specifies which format/highlighting technique to use.

Example
{
  "oldRange": FileDiffHunkRange,
  "oldNoNewlineAt": false,
  "newRange": FileDiffHunkRange,
  "section": "abc123",
  "body": "abc123",
  "highlight": HighlightedDiffHunkBody
}

FileDiffHunkRange

Description

A hunk range in one side (old/new) of a diff.

Fields
Field Name Description
startLine - Int! The first line that the hunk applies to.
lines - Int! The number of lines that the hunk applies to.
Example
{"startLine": 123, "lines": 987}

FileMatch

Description

A file match.

Fields
Field Name Description
file - GitBlob! The file containing the match. KNOWN ISSUE: This file's "commit" field contains incomplete data. KNOWN ISSUE: This field's type should be File! not GitBlob!.
repository - Repository! The repository containing the file match.
revSpec - GitRevSpec The revspec of the revision that contains this match. If no revspec was given (such as when no repository filter or revspec is specified in the search query), it is null.
symbols - [Symbol!]! The symbols found in this file that match the query.
lineMatches - [LineMatch!]! The line matches.
chunkMatches - [ChunkMatch!]! EXPERIMENTAL: This field is experimental and may be unstable. The chunk matches.
limitHit - Boolean! Whether or not the limit was hit.
languages - [String!]! The detected languages for the file, empty if the language cannot be determined.
Example
{
  "file": GitBlob,
  "repository": Repository,
  "revSpec": GitRef,
  "symbols": [Symbol],
  "lineMatches": [LineMatch],
  "chunkMatches": [ChunkMatch],
  "limitHit": true,
  "languages": ["xyz789"]
}

Float

Description

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

Example
123.45

ForkTarget

Description

The target repository that a changeset will be pushed to, if it's not the origin repository.

Fields
Field Name Description
pushUser - Boolean! True if the remote target is a fork in the user namespace associated with the credential used to push the changeset.
namespace - String The specific named fork that the changeset will be pushed to.
Example
{"pushUser": false, "namespace": "xyz789"}

GenericIncompleteDatapointAlert

Description

Represents a terminally incomplete data point at a specific time. Only returns alerts that do not satisfy a specific implementation.

Fields
Field Name Description
time - DateTime! The data point that is incomplete.
reason - String! A message describing why the datapoint was marked incomplete.
Example
{
  "time": "2007-12-03T10:15:30Z",
  "reason": "xyz789"
}

GenericSearchResultInterface

Description

A search result. Every type of search result, except FileMatch, must implement this interface.

Fields
Field Name Description
label - Markdown! A markdown string that is rendered prominently.
url - String! The URL of the result.
detail - Markdown! A markdown string that is rendered less prominently.
matches - [SearchResultMatch!]! A list of matches in this search result.
Possible Types
GenericSearchResultInterface Types

CommitSearchResult

Repository

Example
{
  "label": Markdown,
  "url": "abc123",
  "detail": Markdown,
  "matches": [SearchResultMatch]
}

GitBlob

Description

A Git blob in a repository.

Fields
Field Name Description
path - String! The full path (relative to the repository root) of this blob.
name - String! The base name (i.e., file name only) of this blob's path.
isDirectory - Boolean! False because this is a blob (file), not a directory.
content - String! The content of this blob.
Arguments
startLine - Int

Return blob content starting at line "startLine". A value <= 0 will be the start of the file.

endLine - Int

Return blob content ending at line "endLine". A value < 0 or > totalLines will set endLine to the end of the file.

byteSize - Int! The file size in bytes.
totalLines - Int! Total line count for the Blob. Returns 0 for binary files.
binary - Boolean! Whether or not it is binary.
richHTML - String! The blob contents rendered as rich HTML, or an empty string if it is not a supported rich file type. This HTML string is already escaped and thus is always safe to render.
Arguments
startLine - Int

Return richHTML content starting at line "startLine". A value <= 0 will be the start of the file.

endLine - Int

Return richHTML content ending at line "endLine". A value < 0 or > totalLines will set endLine to the end of the file.

commit - GitCommit! The Git commit containing this blob.
repository - Repository! The repository containing this Git blob.
url - String! The URL to this blob (using the input revision specifier, which may not be immutable).
canonicalURL - String! The canonical URL to this blob (using an immutable revision specifier).
changelistURL - String The URL to this file using the changelist ID if this file is inside a perforce depot.
externalURLs - [ExternalLink!]! The URLs to this blob on its repository's external services.
blame - [Hunk!]! Blame the blob.
Arguments
startLine - Int!
endLine - Int!
ignoreWhitespace - Boolean
highlight - HighlightedFile! Highlight the blob contents.
Arguments
disableTimeout - Boolean!
highlightLongLines - Boolean

If highlightLongLines is true, lines which are longer than 2000 bytes are highlighted. 2000 bytes is enabled. This may produce a significant amount of HTML which some browsers (such as Chrome, but not Firefox) may have trouble rendering efficiently.

format - HighlightResponseFormat

Specifies which format/highlighting technique to use.

startLine - Int

Return highlight content starting at line "startLine". A value <= 0 will be the start of the file. Warning: Pagination only works with the HTML_PLAINTEXT format type at the moment.

endLine - Int

Return highlight content ending at line "endLine". A value < 0 or > totalLines will set endLine to the end of the file. Warning: Pagination only works with the HTML_PLAINTEXT format type at the moment.

languages - [String!]!

The language(s) determined based on the file's name and contents.

The resulting array may be empty if no language could be determined, or it may have multiple entries if the language is ambiguous.

If there are multiple entries, they will be sorted in descending order of likelihood.

submodule - Submodule Submodule metadata if this tree points to a submodule
symbols - SymbolConnection! Symbols defined in this blob.
Arguments
first - Int

Returns the first n symbols from the list.

query - String

Return symbols matching the query.

symbol - Symbol EXPERIMENTAL: Symbol defined in this blob at the specific line number and character offset.
Arguments
line - Int!

The line number (0-based).

character - Int!

The character offset (0-based). The offset is measured in characters, not bytes.

isSingleChild - Boolean! Always false, since a blob is a file, not directory.
lfs - LFS LFS is set if the GitBlob is a pointer to a file stored in LFS.
history - TreeEntryConnection! The revision history for this file
Arguments
first - Int
after - String
ownership - OwnershipConnection! Ownership summary for this file.
Arguments
first - Int

Returns the first n ownership records from the list.

after - String

Opaque pagination cursor.

reasons - [OwnershipReasonType!]

Return only ownership for the given reasons.

Example
{
  "path": "xyz789",
  "name": "xyz789",
  "isDirectory": false,
  "content": "xyz789",
  "byteSize": 123,
  "totalLines": 987,
  "binary": true,
  "richHTML": "abc123",
  "commit": GitCommit,
  "repository": Repository,
  "url": "abc123",
  "canonicalURL": "xyz789",
  "changelistURL": "xyz789",
  "externalURLs": [ExternalLink],
  "blame": [Hunk],
  "highlight": HighlightedFile,
  "languages": ["xyz789"],
  "submodule": Submodule,
  "symbols": SymbolConnection,
  "symbol": Symbol,
  "isSingleChild": true,
  "lfs": LFS,
  "history": TreeEntryConnection,
  "ownership": OwnershipConnection
}

GitBranchChangesetDescription

Description

A description of a changeset that represents the proposal to merge one branch into another. This is used to describe a pull request (on GitHub and Bitbucket Server).

Fields
Field Name Description
baseRepository - Repository! The repository that this changeset spec is proposing to change.
baseRef - String! The full name of the Git ref in the base repository that this changeset is based on (and is proposing to be merged into). This ref must exist on the base repository. For example, "refs/heads/master" or "refs/heads/main".
baseRev - String! The base revision this changeset is based on. It is the latest commit in baseRef at the time when the changeset spec was created. For example: "4095572721c6234cd72013fd49dff4fb48f0f8a4"
headRef - String! The full name of the Git ref that holds the changes proposed by this changeset. This ref will be created or updated with the commits. For example, "refs/heads/fix-foo" (for the Git branch "fix-foo").
title - String!

The title of the changeset on the code host.

On Bitbucket Server or GitHub this is the title of the pull request.

body - String!

The body of the changeset on the code host.

On Bitbucket Server or GitHub this is the body/description of the pull request.

commits - [GitCommitDescription!]!

The Git commits with the proposed changes. These commits are pushed to the head ref.

Only 1 commit is supported.

diff - PreviewRepositoryComparison! The total diff of the changeset diff.
diffStat - DiffStat! The diffstat of this changeset spec. This data is also available indirectly through the diff field above, but if only the diffStat is required, this field is cheaper to access.
published - PublishedValue

Whether or not the changeset described here should be created right after applying the ChangesetSpec this description belongs to.

If this is false, the changeset will only be created on Sourcegraph and can be previewed.

Another ChangesetSpec with the same description, but "published: true", can later be applied to publish the changeset.

Example
{
  "baseRepository": Repository,
  "baseRef": "xyz789",
  "baseRev": "xyz789",
  "headRef": "xyz789",
  "title": "xyz789",
  "body": "xyz789",
  "commits": [GitCommitDescription],
  "diff": PreviewRepositoryComparison,
  "diffStat": DiffStat,
  "published": PublishedValue
}

GitCommit

Description

A Git commit.

Fields
Field Name Description
id - ID! The globally addressable ID for this commit.
repository - Repository! The repository that contains this commit.
oid - GitObjectID! This commit's Git object ID (OID), a 40-character SHA-1 hash.
abbreviatedOID - String! The abbreviated form of this commit's OID.
perforceChangelist - PerforceChangelist EXPERIMENTAL: The perforce changelist ID if this git commit was originally converted from a perforce depot.
author - Signature! This commit's author.
committer - Signature This commit's committer, if any.
message - String! The full commit message.
subject - String! The first line of the commit message.
body - String The contents of the commit message after the first line.
parents - [GitCommit!]! Parent commits of this commit.
url - String! The URL to this commit (using the input revision specifier, which may not be immutable).
canonicalURL - String! The canonical URL to this commit (using an immutable revision specifier).
externalURLs - [ExternalLink!]! The URLs to this commit on its repository's external services.
path - GitTreeOrBlob The Git tree or blob in this commit at the given path.
Arguments
path - String

The path of the tree or blob.

tree - GitTree The Git tree in this commit at the given path.
Arguments
path - String

The path of the tree.

fileNames - [String!]! A list of file names in this repository.
blob - GitBlob The Git blob in this commit at the given path.
Arguments
path - String!
file - File2 The file at the given path for this commit. See "File" documentation for the difference between this field and the "blob" field.
Arguments
path - String!
languages - [String!]! Lists the programming languages present in the tree at this commit.
languageStatistics - [LanguageStatistics!]! List statistics for each language present in the repository.
ancestors - GitCommitConnection! The log of commits consisting of this commit and its ancestors.
Arguments
first - Int

Returns the first n commits from the list.

query - String

Return commits that match the query.

path - String

Return commits that affect the path.

follow - Boolean

Follow history beyond renames (only works for a single file).

after - String

Return commits more recent than the specified date.

afterCursor - String

Skip the first N commits of the repo before returning the number of commits as set in the field "first".

before - String

Return commits older than the specified date.

behindAhead - BehindAheadCounts! Returns the number of commits that this commit is behind and ahead of revspec.
Arguments
revspec - String!
symbols - SymbolConnection! Symbols defined as of this commit. (All symbols, not just symbols that were newly defined in this commit.)
Arguments
first - Int

Returns the first n symbols from the list.

query - String

Return symbols matching the query.

includePatterns - [String!]

A list of regular expressions, all of which must match all file paths returned in the list.

diff - RepositoryComparison! Returns the comparison with another revision.
Arguments
base - String

The base commit to compare to. Defaults to the commit's first parent.

ownership - OwnershipConnection! Owners of the repository at this commit.
Arguments
first - Int

Returns the first n ownership records from the list.

after - String

Opaque pagination cursor.

Example
{
  "id": "4",
  "repository": Repository,
  "oid": GitObjectID,
  "abbreviatedOID": "xyz789",
  "perforceChangelist": PerforceChangelist,
  "author": Signature,
  "committer": Signature,
  "message": "abc123",
  "subject": "abc123",
  "body": "abc123",
  "parents": [GitCommit],
  "url": "abc123",
  "canonicalURL": "xyz789",
  "externalURLs": [ExternalLink],
  "path": GitTree,
  "tree": GitTree,
  "fileNames": ["xyz789"],
  "blob": GitBlob,
  "file": File2,
  "languages": ["abc123"],
  "languageStatistics": [LanguageStatistics],
  "ancestors": GitCommitConnection,
  "behindAhead": BehindAheadCounts,
  "symbols": SymbolConnection,
  "diff": RepositoryComparison,
  "ownership": OwnershipConnection
}

GitCommitConnection

Description

A list of Git commits.

Fields
Field Name Description
nodes - [GitCommit!]! A list of Git commits.
totalCount - Int The total number of Git commits in the connection. If the GitCommitConnection is paginated (e.g., because a "first" parameter was provided to the field that produced it), this field is null to avoid it taking unexpectedly long to compute the total count. Remove the pagination parameters to obtain a non-null value for this field.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [GitCommit],
  "totalCount": 123,
  "pageInfo": PageInfo
}

GitCommitDescription

Description

A description of a Git commit.

Fields
Field Name Description
message - String! The full commit message.
subject - String! The first line of the commit message.
body - String The contents of the commit message after the first line.
author - Person! The Git commit author.
diff - String!

The commit diff (in unified diff format).

The filenames must not be prefixed (e.g., with 'a/' and 'b/'). Tip: use 'git diff --no-prefix' to omit the prefix.

Example
{
  "message": "xyz789",
  "subject": "abc123",
  "body": "xyz789",
  "author": Person,
  "diff": "abc123"
}

GitHubAccount

Description

Represents a GitHub account on which the App was installed.

Fields
Field Name Description
login - String! The login username of the account.
avatarURL - String! The avatar URL of the account.
url - String! A link to the account on GitHub.
type - String! The account type.
Example
{
  "login": "abc123",
  "avatarURL": "xyz789",
  "url": "xyz789",
  "type": "xyz789"
}

GitHubApp

Description

A GitHub App configuration.

Fields
Field Name Description
id - ID! Unique ID of the GitHub App
appID - Int! The GitHub App ID
name - String! The name of the GitHub App
domain - String! The domain of the GitHub App (e.g. "repos" or "batches")
slug - String! The slug of the GitHub App
baseURL - String! The base URL of the GitHub App
appURL - String! The URL of the GitHub App page
clientID - String! The client ID of the GitHub App
clientSecret - String! The client secret of the GitHub App
logo - String! The logo URL of the GitHub App
createdAt - DateTime! The created at timestamp of the GitHub App in our database
updatedAt - DateTime! The updated at timestamp of the GitHub App in our database
installations - [Installation!]! Fetches a list of installation IDs for this GitHub App.
webhook - Webhook Fetches the webhook associated with this GitHub App.
Example
{
  "id": "4",
  "appID": 123,
  "name": "abc123",
  "domain": "abc123",
  "slug": "abc123",
  "baseURL": "abc123",
  "appURL": "xyz789",
  "clientID": "xyz789",
  "clientSecret": "abc123",
  "logo": "abc123",
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z",
  "installations": [Installation],
  "webhook": Webhook
}

GitHubAppConnection

Description

A list of GitHub Apps.

Fields
Field Name Description
nodes - [GitHubApp!]! A list of GitHub Apps.
totalCount - Int! The total count of GitHub Apps in the connection.
Example
{"nodes": [GitHubApp], "totalCount": 987}

GitHubAppDomain

Description

GitHubAppDomain enumerates the domains in which GitHub Apps can be used.

Values
Enum Value Description

REPOS

GitHub Apps that are configured for repository syncing.

BATCHES

GitHub Apps that are configured for batch changes commit signing.
Example
"REPOS"

GitHubCommitVerification

Description

The verification object describing the result of verifying the commit's signature. https://docs.github.com/en/rest/git/commits?apiVersion=2022-11-28#create-a-commit

Fields
Field Name Description
verified - Boolean! Indicates whether GitHub considers the signature in the commit verified
reason - String! The reason for the verified value
signature - String! The signature extracted from the commit
payload - String! The value that was signed
Example
{
  "verified": false,
  "reason": "abc123",
  "signature": "abc123",
  "payload": "xyz789"
}

GitObject

Description

A Git object.

Fields
Field Name Description
oid - GitObjectID! This object's OID.
abbreviatedOID - String! The abbreviated form of this object's OID.
commit - GitCommit The commit object, if it is a commit and it exists; otherwise null.
type - GitObjectType! The Git object's type.
Example
{
  "oid": GitObjectID,
  "abbreviatedOID": "abc123",
  "commit": GitCommit,
  "type": "GIT_COMMIT"
}

GitObjectFilterPreview

Description

A decorated connection of Git objects resulting from 'previewGitObjectFilter'.

Fields
Field Name Description
nodes - [CodeIntelGitObject!]! A list of Git objects composing the current page.
totalCount - Int! The total number of Git objects in this result set.
totalCountYoungerThanThreshold - Int When countObjectsYoungerThanHours is supplied, this holds the total number of Git objects in the result set that have an associated commit date younger than the supplied threshold.
Example
{
  "nodes": [CodeIntelGitObject],
  "totalCount": 123,
  "totalCountYoungerThanThreshold": 123
}

GitObjectID

Description

A Git object ID (SHA-1 hash, 40 hexadecimal characters).

Example
GitObjectID

GitObjectType

Description

All possible types of Git objects.

Values
Enum Value Description

GIT_COMMIT

A Git commit object.

GIT_TAG

A Git tag object.

GIT_TREE

A Git tree object.

GIT_BLOB

A Git blob object.

GIT_UNKNOWN

A Git object of unknown type.
Example
"GIT_COMMIT"

GitRef

Description

A Git ref.

Fields
Field Name Description
id - ID! The globally addressable ID for the Git ref.
name - String! The full ref name (e.g., "refs/heads/mybranch" or "refs/tags/mytag").
abbrevName - String! An unambiguous short name for the ref.
displayName - String! The display name of the ref. For branches ("refs/heads/foo"), this is the branch name ("foo"). As a special case, for GitHub pull request refs of the form refs/pull/NUMBER/head, this is "NUMBER".
prefix - String! The prefix of the ref, either "", "refs/", "refs/heads/", "refs/pull/", or "refs/tags/". This prefix is always a prefix of the ref's name.
type - GitRefType! The type of this Git ref.
target - GitObject! The object that the ref points to.
repository - Repository! The associated repository.
url - String! The URL to this Git ref.
Example
{
  "id": "4",
  "name": "xyz789",
  "abbrevName": "abc123",
  "displayName": "xyz789",
  "prefix": "abc123",
  "type": "GIT_BRANCH",
  "target": GitObject,
  "repository": Repository,
  "url": "abc123"
}

GitRefConnection

Description

A list of Git refs.

Fields
Field Name Description
nodes - [GitRef!]! A list of Git refs.
totalCount - Int! The total count of Git refs in the connection. This total count may be larger than the number of nodes in this object when the result is paginated.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [GitRef],
  "totalCount": 123,
  "pageInfo": PageInfo
}

GitRefOrder

Description

Ordering options for Git refs.

Values
Enum Value Description

AUTHORED_OR_COMMITTED_AT

By the authored or committed at date, whichever is more recent.
Example
"AUTHORED_OR_COMMITTED_AT"

GitRefType

Description

All possible types of Git refs.

Values
Enum Value Description

GIT_BRANCH

A Git branch (in refs/heads/).

GIT_TAG

A Git tag (in refs/tags/).

GIT_REF_OTHER

A Git ref that is neither a branch nor tag.
Example
"GIT_BRANCH"

GitRevSpec

Description

A Git revspec.

Types
Union Types

GitRef

GitRevSpecExpr

GitObject

Example
GitRef

GitRevSpecExpr

Description

A Git revspec expression that (possibly) resolves to a Git revision.

Fields
Field Name Description
expr - String! The original Git revspec expression.
object - GitObject The Git object that the revspec resolves to, or null otherwise.
Example
{
  "expr": "abc123",
  "object": GitObject
}

GitRevisionRange

Description

A Git revision range of the form "base..head" or "base...head". Other revision range formats are not supported.

Fields
Field Name Description
expr - String! The Git revision range expression of the form "base..head" or "base...head".
base - GitRevSpec! The base (left-hand side) of the range.
baseRevSpec - GitRevSpecExpr! The base's revspec as an expression.
head - GitRevSpec! The head (right-hand side) of the range.
headRevSpec - GitRevSpecExpr! The head's revspec as an expression.
mergeBase - GitObject The merge-base of the base and head revisions, if this is a "base...head" revision range. If this is a "base..head" revision range, then this field is null.
Example
{
  "expr": "xyz789",
  "base": GitRef,
  "baseRevSpec": GitRevSpecExpr,
  "head": GitRef,
  "headRevSpec": GitRevSpecExpr,
  "mergeBase": GitObject
}

GitTree

Description

A Git tree in a repository.

Fields
Field Name Description
path - String! The full path (relative to the root) of this tree.
isRoot - Boolean! Whether this tree is the root (top-level) tree.
name - String! The base name (i.e., last path component only) of this tree.
isDirectory - Boolean! True because this is a directory. (The value differs for other TreeEntry interface implementations, such as File.)
commit - GitCommit! The Git commit containing this tree.
repository - Repository! The repository containing this tree.
url - String! The URL to this tree (using the input revision specifier, which may not be immutable).
canonicalURL - String! The canonical URL to this tree (using an immutable revision specifier).
externalURLs - [ExternalLink!]! The URLs to this tree on external services.
rawZipArchiveURL - String! The URL to this entry's raw contents as a Zip archive.
submodule - Submodule Submodule metadata if this tree points to a submodule
directories - [GitTree!]! A list of directories in this tree.
Arguments
first - Int

Returns the first n directories in the tree.

recursive - Boolean

Recurse into sub-trees.

files - [File!]! A list of files in this tree.
Arguments
first - Int

Returns the first n files in the tree.

recursive - Boolean

Recurse into sub-trees.

entries - [TreeEntry!]! A list of entries in this tree.
Arguments
first - Int

Returns the first n files in the tree.

recursive - Boolean

Recurse into sub-trees.

ancestors - Boolean

Includes all parent directories and their entries. For example, if the path is /client/web/something, it will return the following entries in this order:

  • /*
  • /client/*
  • /client/web/*
  • /client/web/something/*

This is useful for rendering a collapsed tree view for the entry.

symbols - SymbolConnection! Symbols defined in this tree.
Arguments
first - Int

Returns the first n symbols from the list.

query - String

Return symbols matching the query.

isSingleChild - Boolean! Whether this tree entry is a single child
history - TreeEntryConnection! The revision history for this file or directory.
Arguments
first - Int
after - String
ownership - OwnershipConnection! Owners of the directory at revision.
Arguments
first - Int

Returns the first n ownership records from the list.

after - String

Opaque pagination cursor.

ownershipStats - OwnershipStats! Ownership statistics for all the files (deeply) contained in this tree.
Example
{
  "path": "xyz789",
  "isRoot": false,
  "name": "abc123",
  "isDirectory": true,
  "commit": GitCommit,
  "repository": Repository,
  "url": "xyz789",
  "canonicalURL": "xyz789",
  "externalURLs": [ExternalLink],
  "rawZipArchiveURL": "xyz789",
  "submodule": Submodule,
  "directories": [GitTree],
  "files": [File],
  "entries": [TreeEntry],
  "symbols": SymbolConnection,
  "isSingleChild": true,
  "history": TreeEntryConnection,
  "ownership": OwnershipConnection,
  "ownershipStats": OwnershipStats
}

GitTreeOrBlob

Description

Either a git tree or blob.

Types
Union Types

GitTree

GitBlob

Example
GitTree

GitUpdatesDisabled

Description

FOR INTERNAL USE ONLY: A status message produced when disableAutoGitUpdates is set to true in the site configuration

Fields
Field Name Description
message - String! The message of this status message
Example
{"message": "xyz789"}

GitserverDiskThresholdReached

Description

FOR INTERNAL USE ONLY: A status message produced when the disk threshold for gitserver is reached.

Fields
Field Name Description
message - String! The message of this status message
Example
{"message": "abc123"}

GitserverInstance

Description

GitserverInfo contains information about a gitserver instance.

Fields
Field Name Description
id - ID! The unique identifier of the gitserver instance.
address - String! The address of the gitserver instance.
freeDiskSpaceBytes - BigInt! The amount of free space available on the gitserver instance, in bytes.
totalDiskSpaceBytes - BigInt! The total amount of storage space on the gitserver instance, in bytes.
Example
{
  "id": 4,
  "address": "xyz789",
  "freeDiskSpaceBytes": {},
  "totalDiskSpaceBytes": {}
}

GitserverInstanceConnection

Description

A list of gitserver instances.

Fields
Field Name Description
nodes - [GitserverInstance!]! A list of gitserver instances.
totalCount - Int! The total count of gitserver instances in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [GitserverInstance],
  "totalCount": 987,
  "pageInfo": PageInfo
}

GlobalChangesetsStats

Description

Stats on all the changesets across the instance.

Fields
Field Name Description
unpublished - Int! The count of unpublished changesets.
draft - Int! The count of draft changesets.
open - Int! The count of open changesets.
merged - Int! The count of merged changesets.
closed - Int! The count of closed changesets.
total - Int! The count of all changesets.
Example
{
  "unpublished": 987,
  "draft": 123,
  "open": 123,
  "merged": 987,
  "closed": 987,
  "total": 987
}

GlobalRankingSummary

Description

THe progress of current and historic precise ranking jobs.

Fields
Field Name Description
rankingSummary - [RankingSummary!]! Precise ranking job summaries ordered reverse-chronologically.
derivativeGraphKey - String The key of the current ranking summary.
nextJobStartsAt - DateTime The time that the next ranking job is configured to begin.
numExportedIndexes - Int! The current number of SCIP indexes that are visible to the ranking calculation.
numTargetIndexes - Int! The target number of SCIP indexes that are visible to the ranking calculation.
numRepositoriesWithoutCurrentRanks - Int! The number of repositories which have ranks but haven't been indexed since the ranking scores became available.
Example
{
  "rankingSummary": [RankingSummary],
  "derivativeGraphKey": "xyz789",
  "nextJobStartsAt": "2007-12-03T10:15:30Z",
  "numExportedIndexes": 123,
  "numTargetIndexes": 123,
  "numRepositoriesWithoutCurrentRanks": 987
}

GroupByField

Description

Fields that can be grouped on for compute powered insights.

Values
Enum Value Description

REPO

LANG

PATH

AUTHOR

DATE

Example
"REPO"

HTTPHeader

Description

A key-value pair

Fields
Field Name Description
name - String! The header name
values - [String!]! Can be multiple values
Example
{
  "name": "abc123",
  "values": ["xyz789"]
}

HappinessFeedbackSubmissionInput

Description

Input for a happiness feedback submission.

Fields
Input Field Description
feedback - String The feedback text from the user.
currentPath - String The path that the happiness feedback will be submitted from.
Example
{
  "feedback": "xyz789",
  "currentPath": "abc123"
}

HiddenApplyPreviewTargets

Description

A preview entry to a repository to which the user has no access.

Example
HiddenApplyPreviewTargetsAttach

HiddenApplyPreviewTargetsAttach

Description

A preview entry where no changeset existed before matching the changeset spec.

Fields
Field Name Description
changesetSpec - HiddenChangesetSpec! The changeset spec from this entry.
Example
{"changesetSpec": HiddenChangesetSpec}

HiddenApplyPreviewTargetsDetach

Description

A preview entry where no changeset spec exists for the changeset currently in the target batch change.

Fields
Field Name Description
changeset - HiddenExternalChangeset! The changeset from this entry.
Example
{"changeset": HiddenExternalChangeset}

HiddenApplyPreviewTargetsUpdate

Description

A preview entry where a changeset matches the changeset spec.

Fields
Field Name Description
changesetSpec - HiddenChangesetSpec! The changeset spec from this entry.
changeset - HiddenExternalChangeset! The changeset from this entry.
Example
{
  "changesetSpec": HiddenChangesetSpec,
  "changeset": HiddenExternalChangeset
}

HiddenBatchSpecWorkspace

Description

A workspace to which the requesting user does not have access.

Fields
Field Name Description
id - ID! The unique ID for the workspace.
batchSpec - BatchSpec! Used for reverse querying.
onlyFetchWorkspace - Boolean! If true, only the files within the workspace will be fetched.
ignored - Boolean! If true, this workspace has been skipped, because some rule forced this. For now, the only one is a .batchignore file existing in the repository.
unsupported - Boolean! If true, this workspace has been skipped, because the code host on which the repository is hosted is not supported.
cachedResultFound - Boolean! Whether we found a task cache result.
stepCacheResultCount - Int! How many steps had a cached result.
queuedAt - DateTime The time when the workspace was enqueued for processing. Null, if not yet enqueued.
startedAt - DateTime The time when the workspace started processing. Null, if not yet started.
finishedAt - DateTime The time when the workspace finished processing. Null, if not yet finished.
state - BatchSpecWorkspaceState! The current state the workspace is in.
placeInQueue - Int The rank of this execution in the queue of the user. The value of this field is null if the execution has started.
placeInGlobalQueue - Int The rank of this execution in the global queue. The value of this field is null if the execution has started.
diffStat - DiffStat The diff stat over all created changeset specs. Null, if not yet finished or failed.
Example
{
  "id": 4,
  "batchSpec": BatchSpec,
  "onlyFetchWorkspace": false,
  "ignored": false,
  "unsupported": false,
  "cachedResultFound": false,
  "stepCacheResultCount": 987,
  "queuedAt": "2007-12-03T10:15:30Z",
  "startedAt": "2007-12-03T10:15:30Z",
  "finishedAt": "2007-12-03T10:15:30Z",
  "state": "SKIPPED",
  "placeInQueue": 987,
  "placeInGlobalQueue": 987,
  "diffStat": DiffStat
}

HiddenChangesetApplyPreview

Description

One preview entry in the list of all previews against a batch spec. Each mapping between changeset specs and current changesets yields one of these. It describes which operations are taken against which changeset spec and changeset to ensure the desired state is met.

Fields
Field Name Description
operations - [ChangesetSpecOperation!]! The operations to take to achieve the desired state.
delta - ChangesetSpecDelta! The delta between the current changeset state and what the new changeset spec envisions the changeset to look like.
targets - HiddenApplyPreviewTargets! The target entities in this preview entry.
Example
{
  "operations": ["PUSH"],
  "delta": ChangesetSpecDelta,
  "targets": HiddenApplyPreviewTargetsAttach
}

HiddenChangesetSpec

Description

A changeset spec is an immutable description of the desired state of a changeset in a batch change. To create a changeset spec, use the createChangesetSpec mutation.

Fields
Field Name Description
id - ID!

The unique ID for a changeset spec.

The ID is unguessable (i.e., long and randomly generated, not sequential). This is important even though repository permissions also apply to viewers of changeset specs, because being allowed to view a repository should not entitle a person to view all not-yet-published changesets for that repository. Consider a batch change to fix a security vulnerability: the batch change author may prefer to prepare all of the changesets in private so that the window between revealing the problem and merging the fixes is as short as possible.

type - ChangesetSpecType! The type of changeset spec.
expiresAt - DateTime The date, if any, when this changeset spec expires and is automatically purged. A changeset spec never expires (and this field is null) if its batch spec has been applied.
Example
{
  "id": 4,
  "type": "EXISTING",
  "expiresAt": "2007-12-03T10:15:30Z"
}

HiddenExternalChangeset

Description

A changeset on a code host that the user does not have access to.

Fields
Field Name Description
id - ID! The unique ID for the changeset.
batchChanges - BatchChangeConnection! The batch changes that contain this changeset.
Arguments
first - Int

Returns the first n batch changes from the list.

after - String

Opaque pagination cursor.

state - BatchChangeState

Only return batch changes in this state. If states is also specified, it will take precedence over state.

states - [BatchChangeState!]

Only return batch changes in any of these states. If state is also specified, states will take precedence over it.

viewerCanAdminister - Boolean

Only include batch changes that the viewer can administer.

state - ChangesetState! The state of the changeset.
createdAt - DateTime! The date and time when the changeset was created.
updatedAt - DateTime! The date and time when the changeset was updated.
nextSyncAt - DateTime The date and time when the next changeset sync is scheduled, or null if none is scheduled.
Example
{
  "id": 4,
  "batchChanges": BatchChangeConnection,
  "state": "UNPUBLISHED",
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z",
  "nextSyncAt": "2007-12-03T10:15:30Z"
}

Highlight

Description

A highlighted region in a string (e.g., matched by a query).

Fields
Field Name Description
line - Int! The 1-indexed line number.
character - Int! The 1-indexed character on the line.
length - Int! The length of the highlight, in characters (on the same line).
Example
{"line": 123, "character": 987, "length": 987}

HighlightLineRange

Description

A specific highlighted line range to fetch.

Fields
Input Field Description
startLine - Int! The first line to fetch (0-indexed, inclusive). Values outside the bounds of the file will automatically be clamped within the valid range.
endLine - Int! The last line to fetch (0-indexed, inclusive). Values outside the bounds of the file will automatically be clamped within the valid range.
Example
{"startLine": 123, "endLine": 987}

HighlightResponseFormat

Description

The format and highlighting to use when requesting highlighting information for a file.

Values
Enum Value Description

HTML_PLAINTEXT

HTML formatted file content without syntax highlighting.

HTML_HIGHLIGHT

HTML formatted file content with syntax highlighting.

JSON_SCIP

SCIP highlighting information as JSON.
Example
"HTML_PLAINTEXT"

HighlightedDiffHunkBody

Description

A highlighted hunk, consisting of all its lines.

Fields
Field Name Description
aborted - Boolean! Whether highlighting was aborted.
lines - [HighlightedDiffHunkLine!]! The highlighted lines.
Example
{"aborted": false, "lines": [HighlightedDiffHunkLine]}

HighlightedDiffHunkLine

Description

A single highlighted line, including the kind of line.

Fields
Field Name Description
html - String! The HTML containing the syntax-highlighted line of code.
kind - DiffHunkLineType! The operation that happened on this line, in patches it is prefixed with '+', '-', ' '. Can be either add, delete, or no change.
Example
{"html": "abc123", "kind": "ADDED"}

HighlightedFile

Description

A highlighted file.

Fields
Field Name Description
aborted - Boolean! Whether or not it was aborted.
html - String! The HTML table that can be used to display the highlighted file.
lsif - String! Base64 encoded JSON payload of LSIF Typed with syntax highlighting data.
lineRanges - [String!]! A list of the desired line ranges. Each list is a list of lines, where each element is an HTML table row '...' string. This is useful if you only need to display specific subsets of the file.
Arguments
Example
{
  "aborted": true,
  "html": "xyz789",
  "lsif": "abc123",
  "lineRanges": ["xyz789"]
}

HighlightedString

Description

A string that has highlights (e.g, query matches).

Fields
Field Name Description
value - String! The full contents of the string.
highlights - [Highlight!]! Highlighted matches of the query in the preview string.
Example
{
  "value": "abc123",
  "highlights": [Highlight]
}

Hunk

Description

A hunk.

Fields
Field Name Description
startLine - Int! The startLine.
endLine - Int! The endLine.
startByte - Int! The startByte.
endByte - Int! The endByte.
rev - String! The rev.
author - Signature! The author.
message - String! The message.
commit - GitCommit! The commit that contains the hunk.
filename - String! The original filename at the commit. Use this filename if you're reading the text contents of the file at the commit field of this hunk. The file may have been renamed after the commit so name of file where this hunk got computed may not exist.
Example
{
  "startLine": 123,
  "endLine": 123,
  "startByte": 987,
  "endByte": 123,
  "rev": "xyz789",
  "author": Signature,
  "message": "xyz789",
  "commit": GitCommit,
  "filename": "abc123"
}

ID

Description

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

Example
4

IncompleteDatapointAlert

Description

Represents a terminally incomplete data point at a specific time, and optionally for a specific repository.

Fields
Field Name Description
time - DateTime! The data point that is incomplete.
Possible Types
IncompleteDatapointAlert Types

TimeoutDatapointAlert

GenericIncompleteDatapointAlert

Example
{"time": "2007-12-03T10:15:30Z"}

IndexConfiguration

Description

Explicit configuration for indexing a repository.

Fields
Field Name Description
configuration - String The raw JSON-encoded index configuration.
parsedConfiguration - [AutoIndexJobDescription!] The parsed index configuration (decoded from the raw JSON version).
inferredConfiguration - InferredConfiguration The raw JSON-encoded index configuration as inferred by the auto-indexer.
Example
{
  "configuration": "xyz789",
  "parsedConfiguration": [AutoIndexJobDescription],
  "inferredConfiguration": InferredConfiguration
}

IndexStep

Description

The configuration and execution summary of the indexer.

Fields
Field Name Description
commands - [String!]! Commands to run in the same image as the indexer but before the indexer is invoked.
indexerArgs - [String!]! The arguments to supply to the indexer container.
outfile - String The path to the index file relative to the root directory (dump.lsif by default).
requestedEnvVars - [String!] A list of environment variables (VAR=VAL) that should be made available to the indexer.
logEntry - ExecutionLogEntry The execution summary (if completed or errored) of the index command.
Example
{
  "commands": ["abc123"],
  "indexerArgs": ["abc123"],
  "outfile": "abc123",
  "requestedEnvVars": ["abc123"],
  "logEntry": ExecutionLogEntry
}

IndexSteps

Description

Configuration and execution summary of an index job.

Fields
Field Name Description
setup - [ExecutionLogEntry!]! Execution log entries related to setting up the indexing workspace.
preIndex - [PreIndexStep!]! Configuration and execution summary (if completed or errored) of steps to be performed prior to indexing.
index - IndexStep! Configuration and execution summary (if completed or errored) of the indexer.
upload - ExecutionLogEntry Execution log entry related to uploading the dump produced by the indexing step. This field be missing if the upload step had not been executed.
teardown - [ExecutionLogEntry!]! Execution log entries related to tearing down the indexing workspace.
Example
{
  "setup": [ExecutionLogEntry],
  "preIndex": [PreIndexStep],
  "index": IndexStep,
  "upload": ExecutionLogEntry,
  "teardown": [ExecutionLogEntry]
}

IndexerWithCount

Description

A precise indexer paired with a count of indexable projects in the repository (used by CodeIntelSummary).

Fields
Field Name Description
indexer - CodeIntelIndexer The repository.
count - Int! The count of projects that could utilize the indexer in this repository.
Example
{"indexer": CodeIntelIndexer, "count": 987}

IndexingProgress

Description

FOR INTERNAL USE ONLY: A status message produced when repositories are being indexed for search.

Fields
Field Name Description
notIndexed - Int! The number of repositories that have not been indexed yet.
indexed - Int! The number of repositories that have been indexed.
Example
{"notIndexed": 987, "indexed": 987}

InferAutoIndexJobsResult

Description

The result of running the auto-index inference script over a particular repo.

Fields
Field Name Description
jobs - [AutoIndexJobDescription!]! The list of inferred jobs.
inferenceOutput - String! The output from the inference script.
Example
{
  "jobs": [AutoIndexJobDescription],
  "inferenceOutput": "abc123"
}

InferredAvailableIndexers

Description

The additionally available indexers that have been inferred from jobs and job hints that could be indexed but haven't been indexed.

Fields
Field Name Description
indexer - CodeIntelIndexer! The indexer.
roots - [String!]! The list of roots that could be indexed.
rootsWithKeys - [RootWithKey!]! The list of roots that could be indexed.
Example
{
  "indexer": CodeIntelIndexer,
  "roots": ["xyz789"],
  "rootsWithKeys": [RootWithKey]
}

InferredConfiguration

Description

A wrapper around inferred configuration and a possible limit error.

Fields
Field Name Description
configuration - String! The raw JSON-encoded inferred index configuration.
parsedConfiguration - [AutoIndexJobDescription!] The parsed index configuration (decoded from the raw JSON version).
limitError - String If inference of the repository contents hit a limit its error description will available here.
Example
{
  "configuration": "abc123",
  "parsedConfiguration": [AutoIndexJobDescription],
  "limitError": "xyz789"
}

InsightBackfillQueueItem

Description

Information about an item in the insights backfill queue

Fields
Field Name Description
id - ID! The ID of the Backfill item
insightViewTitle - String! The title of the insight view
creator - User The user that originally created the insight view
seriesLabel - String! The name of the series on the associated insight view
seriesSearchQuery - String! The search query for the series
backfillQueueStatus - BackfillStatus! Information on the current backfill status
Example
{
  "id": 4,
  "insightViewTitle": "xyz789",
  "creator": User,
  "seriesLabel": "abc123",
  "seriesSearchQuery": "abc123",
  "backfillQueueStatus": BackfillStatus
}

InsightBackfillQueueItemConnection

Description

Returns information regarding the insights backfill queue to admin users.

Fields
Field Name Description
nodes - [InsightBackfillQueueItem!]! A list of insight backfill queue items.
totalCount - Int! The total number of insight backfill queue items in the connection.
pageInfo - ConnectionPageInfo! Pagination information.
Example
{
  "nodes": [InsightBackfillQueueItem],
  "totalCount": 987,
  "pageInfo": ConnectionPageInfo
}

InsightDataPoint

Description

A code insight data point.

Fields
Field Name Description
dateTime - DateTime! The time of this data point.
value - Float! The value of the insight at this point in time.
diffQuery - String A search query that will show the diff between this point and the previous point
Example
{
  "dateTime": "2007-12-03T10:15:30Z",
  "value": 123.45,
  "diffQuery": "abc123"
}

InsightDataSeriesDefinition

Description

Defines how the data series is generated.

Example
SearchInsightDataSeriesDefinition

InsightIntervalTimeScope

Description

Defines a time scope using an interval of time

Fields
Field Name Description
unit - TimeIntervalStepUnit! The unit of time.
value - Int! The value of time.
Example
{"unit": "HOUR", "value": 123}

InsightPresentation

Description

Defines presentation options for the insight.

Example
LineChartInsightViewPresentation

InsightQueueItemState

Description

Possible queue states

Values
Enum Value Description

NEW

QUEUED

COMPLETED

PROCESSING

FAILED

UNKNOWN

Example
"NEW"

InsightRepositoryDefinition

Description

Defines how the scope of repositories was generated

Example
RepositorySearchScope

InsightRepositoryScope

Description

A custom repository scope for an insight. A scope with all empty fields implies a global scope.

Fields
Field Name Description
repositories - [String!]! The list of repositories in the scope.
Example
{"repositories": ["abc123"]}

InsightSeriesMetadata

Description

Metadata about a specific data series for an insight.

Fields
Field Name Description
seriesId - String! Unique ID for the series.
query - String! Sourcegraph query string used to generate the series.
enabled - Boolean! Current status of the series.
Example
{
  "seriesId": "abc123",
  "query": "xyz789",
  "enabled": false
}

InsightSeriesMetadataPayload

Description

Wrapper payload object for insight series metadata.

Fields
Field Name Description
series - InsightSeriesMetadata! The series metadata.
Example
{"series": InsightSeriesMetadata}

InsightSeriesQueryStatus

Description

Information about queue status for insight series queries.

Fields
Field Name Description
seriesId - String! Unique ID for the series.
query - String! Sourcegraph query string used to generate the series. This is the base query string that was input by the user, and does not include each repository specific query that would be generated to backfill an entire series.
enabled - Boolean! The current activity status for this series.
errored - Int! The number of queries belonging to the series with errored status. Errored is a transient state representing a retryable error that has not yet exceeded the max retry count. This count only represents the queries that have yet to be pruned by the background maintenance workers.
completed - Int! The number of queries belonging to the series that are successfully completed. This count only represents the queries that have yet to be pruned by the background maintenance workers.
processing - Int! The number of queries belonging to the series that are currently processing. This count only represents the queries that have yet to be pruned by the background maintenance workers.
failed - Int! The number of queries belonging to the series that are terminally failed. These have either been marked as non-retryable or exceeded the max retry limit. This count only represents the queries that have yet to be pruned by the background maintenance workers.
queued - Int! The number of queries belonging to the series that are queued for processing. This count only represents the queries that have yet to be pruned by the background maintenance workers.
Example
{
  "seriesId": "xyz789",
  "query": "xyz789",
  "enabled": true,
  "errored": 987,
  "completed": 123,
  "processing": 987,
  "failed": 987,
  "queued": 987
}

InsightSeriesStatus

Description

Status indicators for a specific series of insight data.

Fields
Field Name Description
totalPoints - Int!

The total number of points stored for this series, at the finest level (e.g. per repository, or per-repository-per-language) Has no strict relation to the data points shown in the web UI or returned by points(), because those are aggregated and this number can report some duplicates points which get stored but removed at query time for the web UI.

Why its useful: an insight may look like "it is doing nothing" but in reality this number will be increasing by e.g. several thousands of points rapidly.

pendingJobs - Int!

The total number of jobs currently pending to add new data points for this series.

Each job may create multiple data points (e.g. a job may create one data point per repo, or language, etc.) This number will go up and down over time until all work is completed (discovering work takes almost as long as doing the work.)

Why its useful: signals "amount of work still to be done."

completedJobs - Int!

The total number of jobs completed for this series. Note that since pendingJobs will go up/down over time, you CANNOT divide these two numbers to get a percentage as it would be nonsense ("it says 90% complete but has been like that for a really long time!").

Does not include 'failedJobs'.

Why its useful: gives an indication of "how much work has been done?"

failedJobs - Int!

The total number of jobs that were tried multiple times and outright failed. They will not be retried again, and indicates the series has incomplete data.

Use ((failedJobs / completedJobs) * 100.0) to get an approximate percentage of how much data the series data may be missing (e.g. ((30 / 150)*100.0) == 20% of the series data is incomplete (rough approximation, not precise).

Why its useful: signals if there are problems, and how severe they are.

backfillQueuedAt - DateTime The time that the insight series completed a full iteration and queued up records for processing. This can effectively be used as a status that the insight is still processing if returned null.
isLoadingData - Boolean Indicates if the series is currently loading additional data
incompleteDatapoints - [IncompleteDatapointAlert!]! Data points that are flagged terminally incomplete for this series.
Example
{
  "totalPoints": 987,
  "pendingJobs": 123,
  "completedJobs": 123,
  "failedJobs": 987,
  "backfillQueuedAt": "2007-12-03T10:15:30Z",
  "isLoadingData": true,
  "incompleteDatapoints": [IncompleteDatapointAlert]
}

InsightTimeScope

Description

Defines a scope of time for which the insight data is generated.

Types
Union Types

InsightIntervalTimeScope

Example
InsightIntervalTimeScope

InsightView

Description

An Insight View is a lens to view insight data series. In most cases this corresponds to a visualization of an insight, containing multiple series.

Fields
Field Name Description
id - ID! The View ID.
defaultFilters - InsightViewFilters! The default filters saved on the insight. This will differ from the applied filters if they are overwritten but not saved.
appliedFilters - InsightViewFilters! The filters currently applied to the insight and the data.
dataSeries - [InsightsSeries!]! The time series data for this insight.
presentation - InsightPresentation! Presentation options for the insight.
dataSeriesDefinitions - [InsightDataSeriesDefinition!]! Information on how each data series was generated
dashboardReferenceCount - Int! The total number of dashboards on which this insight is referenced. The count is global and disregards permissions.
isFrozen - Boolean! Represents if this insight is in a frozen state or not. A frozen state is relevant when a license is downgraded and the number of insights exceed the free plan limits.
defaultSeriesDisplayOptions - SeriesDisplayOptions! The default series display options saved on the insight. This will differ from the applied options if they are overwritten but not saved.
appliedSeriesDisplayOptions - SeriesDisplayOptions! The series display options currently applied to the insight.
dashboards - InsightsDashboardConnection Dashboards this insight has been added to that the current user has permission to view
Arguments
first - Int
after - String
id - ID
seriesCount - Int The total number of series on this insight.
repositoryDefinition - InsightRepositoryDefinition! The Repositories the dataSeries on this insight will operate over.
timeScope - InsightTimeScope! The scope of time for which the insight data is generated.
Example
{
  "id": 4,
  "defaultFilters": InsightViewFilters,
  "appliedFilters": InsightViewFilters,
  "dataSeries": [InsightsSeries],
  "presentation": LineChartInsightViewPresentation,
  "dataSeriesDefinitions": [
    SearchInsightDataSeriesDefinition
  ],
  "dashboardReferenceCount": 123,
  "isFrozen": false,
  "defaultSeriesDisplayOptions": SeriesDisplayOptions,
  "appliedSeriesDisplayOptions": SeriesDisplayOptions,
  "dashboards": InsightsDashboardConnection,
  "seriesCount": 987,
  "repositoryDefinition": RepositorySearchScope,
  "timeScope": InsightIntervalTimeScope
}

InsightViewConnection

Description

A dashboard of insight views.

Fields
Field Name Description
nodes - [InsightView]! A list of insights.
pageInfo - PageInfo! Pagination information.
totalCount - Int The total number of insights in the connection.
Example
{
  "nodes": [InsightView],
  "pageInfo": PageInfo,
  "totalCount": 987
}

InsightViewControlsInput

Description

Input for the default values for filters and aggregates for an insight.

Fields
Input Field Description
filters - InsightViewFiltersInput! Input for the default filters for an insight.
seriesDisplayOptions - SeriesDisplayOptionsInput! Input for series' sort order.
Example
{
  "filters": InsightViewFiltersInput,
  "seriesDisplayOptions": SeriesDisplayOptionsInput
}

InsightViewDebug

Description

Debugging information related to an InsightView

Fields
Field Name Description
raw - [String!]! A JSON dump of debug information for series on the insight view
Example
{"raw": ["xyz789"]}

InsightViewFilters

Description

The fields and values for which the insight is filtered.

Fields
Field Name Description
includeRepoRegex - String A regex string for which to include repositories in a filter.
excludeRepoRegex - String A regex string for which to exclude repositories from a filter.
searchContexts - [String!] The names of query based search contexts that are used as a filter.
Example
{
  "includeRepoRegex": "xyz789",
  "excludeRepoRegex": "xyz789",
  "searchContexts": ["abc123"]
}

InsightViewFiltersInput

Description

Input for the default values by which the insight is filtered.

Fields
Input Field Description
includeRepoRegex - String A regex string for which to include repositories in a filter.
excludeRepoRegex - String A regex string for which to exclude repositories in a filter.
searchContexts - [String!] A list of query based search contexts to include in the filters for the view.
Example
{
  "includeRepoRegex": "abc123",
  "excludeRepoRegex": "abc123",
  "searchContexts": ["xyz789"]
}

InsightViewPayload

Description

Response wrapper object for insight view mutations.

Fields
Field Name Description
view - InsightView! The resulting view.
Example
{"view": InsightView}

InsightsDashboard

Description

A dashboard of insights.

Fields
Field Name Description
id - ID! The Dashboard ID.
title - String! The Dashboard Title.
views - InsightViewConnection The list of associated insights to the dashboard.
Arguments
first - Int
after - ID
grants - InsightsPermissionGrants! The permission grants assossiated with the dashboard.
Example
{
  "id": "4",
  "title": "abc123",
  "views": InsightViewConnection,
  "grants": InsightsPermissionGrants
}

InsightsDashboardConnection

Description

A paginated list of dashboards.

Fields
Field Name Description
nodes - [InsightsDashboard!]! A list of dashboards.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [InsightsDashboard],
  "pageInfo": PageInfo
}

InsightsDashboardPayload

Description

Response wrapper object for insight dashboard mutations.

Fields
Field Name Description
dashboard - InsightsDashboard! The result dashboard after mutation.
Example
{"dashboard": InsightsDashboard}

InsightsPermissionGrants

Description

Permissions object. Note: only organizations the user has access to will be included.

Fields
Field Name Description
users - [ID!]! Specific users that have permission.
organizations - [ID!]! Organizations that have permission.
global - Boolean! True if the permission is set to global.
Example
{"users": [4], "organizations": [4], "global": true}

InsightsPermissionGrantsInput

Description

Input object for permissions to grant.

Fields
Input Field Description
users - [ID!] Specific users to grant permissions to.
organizations - [ID!] Organizations to grant permissions to.
global - Boolean Set global to true to grant global permission.
Example
{
  "users": ["4"],
  "organizations": [4],
  "global": true
}

InsightsSeries

Description

A series of data about a code insight.

Fields
Field Name Description
seriesId - String! Unique ID for the series.
label - String! The label used to describe this series of data points.
points - [InsightDataPoint!]!

Data points over a time range (inclusive)

The 'from', 'to', 'includeRepoRegex' and 'excludeRepoRegex' arguments have been deprecated. They will have no affect on the points returned and will be removed in a future version.

Arguments
from - DateTime
to - DateTime
includeRepoRegex - String
excludeRepoRegex - String
status - InsightSeriesStatus! The status of this series of data, e.g. progress collecting it.
Example
{
  "seriesId": "abc123",
  "label": "abc123",
  "points": [InsightDataPoint],
  "status": InsightSeriesStatus
}

Installation

Description

Represents a single GitHub App installation.

Fields
Field Name Description
id - Int! The installation ID of the App.
url - String! The installation URL.
account - GitHubAccount! The account on which the App was installed
externalServices - ExternalServiceConnection! The external services derived from this installation.
Arguments
first - Int
Example
{
  "id": 123,
  "url": "xyz789",
  "account": GitHubAccount,
  "externalServices": ExternalServiceConnection
}

Int

Description

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

Example
987

InviteUserToOrganizationResult

Description

The result of Mutation.inviteUserToOrganization.

Fields
Field Name Description
sentInvitationEmail - Boolean! Whether an invitation email was sent. If emails are not enabled on this site or if the user has no verified email address, an email will not be sent.
invitationURL - String! The URL that the invited user can visit to accept or reject the invitation.
Example
{
  "sentInvitationEmail": true,
  "invitationURL": "xyz789"
}

JSONCString

Description

A string that contains valid JSON, with additional support for //-style comments and trailing commas.

Example
JSONCString

JSONValue

Description

A valid JSON value.

Example
JSONValue

KeyPathSegment

Description

A segment of a key path that locates a nested JSON value in a root JSON value. Exactly one field in each KeyPathSegment must be non-null. For example, in {"a": [0, {"b": 3}]}, the value 3 is located at the key path ["a", 1, "b"].

Fields
Input Field Description
property - String The name of the property in the object at this location to descend into.
index - Int The index of the array at this location to descend into.
Example
{"property": "xyz789", "index": 123}

KeyValuePair

Description

A key-value pair

Fields
Field Name Description
key - String! The non-nullable key.
value - String The nullable value. A null value indicates this key-value pair should be treated as a tag.
Example
{
  "key": "abc123",
  "value": "abc123"
}

LFS

Description

Information about a blob stored in Git Large File Storage (LFS).

Fields
Field Name Description
byteSize - BigInt! The size of the file in LFS in bytes. Note: the file size in the GitBlob will be the size of the pointer not the file a user checks out.
Example
{"byteSize": {}}

LSIFUploadAuditLog

Description

Contains the metadata and upload data for a single state change of an upload.

Fields
Field Name Description
logTimestamp - DateTime! The timestamp the log was emitted at.
uploadDeletedAt - DateTime The timestamp when the associated upload was deleted at.
reason - String The reason for this change in data.
changedColumns - [AuditLogColumnChange!]! A list of changed columns in the format {"column": "", "new": "", "old": ""}
uploadId - ID! The ID of the upload.
inputCommit - String! The original 40-character commit commit supplied at upload time.
inputRoot - String! The original root supplied at upload time.
inputIndexer - String! The original indexer name supplied at upload time.
uploadedAt - DateTime! The time the upload was uploaded.
operation - AuditLogOperation! The operation denoted by this log.
Example
{
  "logTimestamp": "2007-12-03T10:15:30Z",
  "uploadDeletedAt": "2007-12-03T10:15:30Z",
  "reason": "xyz789",
  "changedColumns": [AuditLogColumnChange],
  "uploadId": "4",
  "inputCommit": "abc123",
  "inputRoot": "xyz789",
  "inputIndexer": "xyz789",
  "uploadedAt": "2007-12-03T10:15:30Z",
  "operation": "CREATE"
}

LanguageStatistics

Description

Statistics about a language's usage.

Fields
Field Name Description
name - String! The name of the language.
totalBytes - Float! The total bytes in the language.
totalLines - Int! The total number of lines in the language.
Example
{
  "name": "xyz789",
  "totalBytes": 123.45,
  "totalLines": 123
}

LicenseInfo

Description

License information extracted from license key.

Fields
Field Name Description
tags - [String!]! Tags of the license.
userCount - Int! The number of users that can use the license.
expiresAt - DateTime! The expiration date of the license.
Example
{
  "tags": ["xyz789"],
  "userCount": 123,
  "expiresAt": "2007-12-03T10:15:30Z"
}

LineChartDataSeriesOptionsInput

Description

Options for a line chart data series

Fields
Input Field Description
label - String The label for the data series.
lineColor - String The line color for the data series.
Example
{
  "label": "xyz789",
  "lineColor": "abc123"
}

LineChartDataSeriesPresentation

Description

View presentation for a single insight line chart data series

Fields
Field Name Description
seriesId - String! Unique ID for the series.
label - String! The label for the series.
color - String! The color for the series.
Example
{
  "seriesId": "xyz789",
  "label": "abc123",
  "color": "xyz789"
}

LineChartInsightViewPresentation

Description

View presentation for a line chart insight

Fields
Field Name Description
title - String! The title for the line chart.
seriesPresentation - [LineChartDataSeriesPresentation!]! The presentation options for the line chart.
Example
{
  "title": "xyz789",
  "seriesPresentation": [LineChartDataSeriesPresentation]
}

LineChartOptionsInput

Description

Options for a line chart

Fields
Input Field Description
title - String The chart title.
Example
{"title": "abc123"}

LineChartSearchInsightDataSeriesInput

Description

Input for a line chart search insight data series.

Fields
Input Field Description
seriesId - String Unique ID for the series. Omit this field if it's a new series.
query - String! The query string.
options - LineChartDataSeriesOptionsInput! Options for this line chart data series.
repositoryScope - RepositoryScopeInput The scope of repositories. The repository scope can be provided at the LineChartSearchInsightInput level. If scope is provided here will take priority of any other scope provide at a higher level in the input.
timeScope - TimeScopeInput The scope of time. This time scope can also be provided at the LineChartSearchInsightInput level. If the scope is provided here it will take priority over any other scope provided at a higher level in the input.
generatedFromCaptureGroups - Boolean Whether or not to generate the timeseries results from the query capture groups. Defaults to false if not provided.
groupBy - GroupByField The field to group results by. (For compute powered insights only.) This field is experimental and should be considered unstable in the API.
Example
{
  "seriesId": "xyz789",
  "query": "xyz789",
  "options": LineChartDataSeriesOptionsInput,
  "repositoryScope": RepositoryScopeInput,
  "timeScope": TimeScopeInput,
  "generatedFromCaptureGroups": false,
  "groupBy": "REPO"
}

LineChartSearchInsightInput

Description

Input for a line chart search insight.

Fields
Input Field Description
dataSeries - [LineChartSearchInsightDataSeriesInput!]! The list of data series to create (or add) to this insight.
repositoryScope - RepositoryScopeInput The scope of repositories for the insight. If provided here it will apply to all series unless overwritten.
timeScope - TimeScopeInput The scope of time for the insight view. If provided here it will apply to all series unless overwritten.
options - LineChartOptionsInput! The options for this line chart.
dashboards - [ID!] The dashboard IDs to associate this insight with once created.
viewControls - InsightViewControlsInput The default values for filters and aggregates for this line chart.
Example
{
  "dataSeries": [LineChartSearchInsightDataSeriesInput],
  "repositoryScope": RepositoryScopeInput,
  "timeScope": TimeScopeInput,
  "options": LineChartOptionsInput,
  "dashboards": [4],
  "viewControls": InsightViewControlsInput
}

LineMatch

Description

A line match.

Fields
Field Name Description
preview - String! The preview.
lineNumber - Int! The line number. 0-based. The first line will have lineNumber 0. Note: A UI will normally display line numbers 1-based.
offsetAndLengths - [Int!]! Tuples of [offset, length] measured in characters (not bytes).
limitHit - Boolean! Whether or not the limit was hit. will always be false
Example
{
  "preview": "abc123",
  "lineNumber": 987,
  "offsetAndLengths": [987],
  "limitHit": true
}

Location

Description

A location inside a resource (in a repository at a specific commit).

Fields
Field Name Description
resource - CodeIntelGitBlob! The file that this location refers to.
range - Range The range inside the file that this location refers to.
url - String! The URL to this location (using the input revision specifier, which may not be immutable).
canonicalURL - String! The canonical URL to this location (using an immutable revision specifier).
Example
{
  "resource": CodeIntelGitBlob,
  "range": Range,
  "url": "xyz789",
  "canonicalURL": "abc123"
}

Markdown

Description

An object representing a markdown string.

Fields
Field Name Description
text - String! The raw markdown string.
html - String! HTML for the rendered markdown string, or null if there is no HTML representation provided. If specified, clients should render this directly.
Example
{
  "text": "xyz789",
  "html": "abc123"
}

MarkdownBlock

Description

Markdown block renders the Markdown formatted input string into HTML.

Fields
Field Name Description
id - String! ID of the block.
markdownInput - String! Markdown formatted input string.
Example
{
  "id": "xyz789",
  "markdownInput": "abc123"
}

MarkdownOptions

Description

Describes options for rendering Markdown.

Fields
Input Field Description
alwaysNil - String A dummy null value (empty input types are not allowed yet).
Example
{"alwaysNil": "abc123"}

Message

Description

Message to or from the LLM

Fields
Input Field Description
speaker - SpeakerType! Speaker of the message (human/assistant)
text - String! Text content of the message
Example
{"speaker": "HUMAN", "text": "xyz789"}

MirrorRepositoryInfo

Description

Information and status about the mirroring of a repository. In this case, the remote source repository is external to Sourcegraph and the mirror is maintained by the Sourcegraph site (not the other way around).

Fields
Field Name Description
remoteURL - String! The URL of the remote source repository.
cloneInProgress - Boolean! Whether the clone of the repository has begun but not yet completed.
cloneProgress - String A single line of text that contains progress information for the running clone command. The format of the progress text is not specified. It is intended to be displayed directly to a user. e.g. "Receiving objects: 95% (2041/2148), 292.01 KiB | 515.00 KiB/s" "Resolving deltas: 9% (117/1263)"
cloned - Boolean! Whether the repository has ever been successfully cloned.
isCorrupted - Boolean! Whether the repository is currently corrupt.
corruptionLogs - [RepoCorruptionLog!]! A Log of the corruption events that have been detected on this repository. Only 10 events are kept and the events are ordered from most recent to least.
updatedAt - DateTime When the repository was last successfully updated from the remote source repository.
nextSyncAt - DateTime When the repository is next scheduled to be updated from the remote source repository.
updateSchedule - UpdateSchedule The state of this repository in the update schedule.
updateQueue - UpdateQueue The state of this repository in the update queue.
lastError - String The last error message, if any, returned when fetching or cloning the repo
lastSyncOutput - String The output of the most recent repo sync job
byteSize - BigInt! The byte size of the repo.
shard - String The gitserver shard on which the repository is or will be cloned. Only site admins can access this field.
Example
{
  "remoteURL": "xyz789",
  "cloneInProgress": true,
  "cloneProgress": "abc123",
  "cloned": false,
  "isCorrupted": false,
  "corruptionLogs": [RepoCorruptionLog],
  "updatedAt": "2007-12-03T10:15:30Z",
  "nextSyncAt": "2007-12-03T10:15:30Z",
  "updateSchedule": UpdateSchedule,
  "updateQueue": UpdateQueue,
  "lastError": "abc123",
  "lastSyncOutput": "abc123",
  "byteSize": {},
  "shard": "xyz789"
}

MonitoringAlert

Description

A high-level monitoring alert, for details see https://docs.sourcegraph.com/admin/observability/metrics#high-level-alerting-metrics

Fields
Field Name Description
timestamp - DateTime! End time of this event, which describes the past 12h of recorded data.
name - String! Name of alert that the service fired.
serviceName - String! Name of the service that fired the alert.
owner - String! Owner of the fired alert.
average - Float! Average percentage of time (between [0, 1]) that the event was firing over the 12h of recorded data. e.g. 1.0 if it was firing 100% of the time on average during that 12h window, 0.5 if it was firing 50% of the time on average, etc.
Example
{
  "timestamp": "2007-12-03T10:15:30Z",
  "name": "abc123",
  "serviceName": "abc123",
  "owner": "abc123",
  "average": 987.65
}

MonitoringStatistics

Description

Monitoring overview.

Fields
Field Name Description
alerts - [MonitoringAlert!]! Alerts fired in this time span. No longer supported, and will no longer return data - query will be removed after Sourcegraph 4.5
Example
{"alerts": [MonitoringAlert]}

Namespace

Description

A namespace is a container for certain types of data and settings, such as a user or organization.

Fields
Field Name Description
id - ID! The globally unique ID of this namespace.
namespaceName - String! The name of this namespace's component. For a user, this is the username. For an organization, this is the organization name.
url - String! The URL to this namespace.
Possible Types
Namespace Types

User

Org

Example
{
  "id": "4",
  "namespaceName": "abc123",
  "url": "xyz789"
}

NewRepositoryConnection

Description

A list of repositories.

The old RepositoryConnection is deprecated and is replaced by this new connection which support proper cursor based pagination. The new connection does not include precise argument for totalCount.

Fields
Field Name Description
nodes - [Repository!]! A list of repositories.
totalCount - Int! The total count of repositories in the connection.
pageInfo - ConnectionPageInfo! Pagination information.
Example
{
  "nodes": [Repository],
  "totalCount": 123,
  "pageInfo": ConnectionPageInfo
}

NewUsersConnection

Description

A paginated connection for users.

Fields
Field Name Description
nodes - [User!]! A list of users.
totalCount - Int! The total number of users in the connection.
pageInfo - ConnectionPageInfo! Pagination information.
Example
{
  "nodes": [User],
  "totalCount": 123,
  "pageInfo": ConnectionPageInfo
}

NoRepositoriesDetected

Description

FOR INTERNAL USE ONLY: A status message produced when there are no repositories and no sync jobs in process

Fields
Field Name Description
message - String! The message of this status message
Example
{"message": "abc123"}

Node

NonExhaustiveSearchAggregationResult

Description

Information regarding the results of an exhaustive search aggregation

Fields
Field Name Description
groups - [AggregationGroup!]! A list of the first [LIMIT] aggregation groups in decreasing order
supportsPersistence - Boolean Boolean indicating if the search query support being persisted as an insight on a dashboard
otherResultCount - Int A count to capture the total number of results that are not included in the list of values returned.
approximateOtherGroupCount - Int An approximate count of the total number of aggregation groups that were not available in the values list
mode - SearchAggregationMode! The SearchAggregationMode the results relate to
Example
{
  "groups": [AggregationGroup],
  "supportsPersistence": false,
  "otherResultCount": 987,
  "approximateOtherGroupCount": 123,
  "mode": "REPO"
}

NotAvailableReasonType

Description

An enum to describe the reasons why search aggregations are not available

Values
Enum Value Description

INVALID_QUERY

INVALID_AGGREGATION_MODE_FOR_QUERY

TIMEOUT_EXTENSION_AVAILABLE

TIMEOUT_NO_EXTENSION_AVAILABLE

OTHER_ERROR

Example
"INVALID_QUERY"

Notebook

Description

A notebook with an array of blocks.

Fields
Field Name Description
id - ID! The unique id of the notebook.
title - String! The title of the notebook.
blocks - [NotebookBlock!]! Array of notebook blocks.
creator - User User that created the notebook or null if the user was removed.
updater - User User that last updated the notebook or null if that user was removed.
namespace - Namespace Notebook namespace or null if the namespace (user or org) was removed.
public - Boolean! Public property controls the visibility of the notebook. A public notebook is available to any user on the instance. Private notebooks are only available to their creators.
updatedAt - DateTime! Date and time the notebook was last updated.
createdAt - DateTime! Date and time the notebook was created.
viewerCanManage - Boolean! If current viewer can manage (edit, delete) the notebook.
viewerHasStarred - Boolean! If current viewer has starred the notebook.
stars - NotebookStarConnection! Notebook stars.
Arguments
first - Int

Returns the first n notebook stars from the list.

after - String

Opaque pagination cursor.

Example
{
  "id": "4",
  "title": "xyz789",
  "blocks": [MarkdownBlock],
  "creator": User,
  "updater": User,
  "namespace": Namespace,
  "public": true,
  "updatedAt": "2007-12-03T10:15:30Z",
  "createdAt": "2007-12-03T10:15:30Z",
  "viewerCanManage": true,
  "viewerHasStarred": true,
  "stars": NotebookStarConnection
}

NotebookBlock

Description

Notebook blocks are a union of distinct block types: Markdown, Query, File, Symbol, and Compute.

Example
MarkdownBlock

NotebookBlockType

Description

Enum of possible block types.

Values
Enum Value Description

MARKDOWN

QUERY

FILE

SYMBOL

Example
"MARKDOWN"

NotebookConnection

Description

A paginated list of notebooks.

Fields
Field Name Description
nodes - [Notebook!]! A list of notebooks.
totalCount - Int! The total number of notebooks in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [Notebook],
  "totalCount": 987,
  "pageInfo": PageInfo
}

NotebookInput

Description

Input for a new notebook.

Fields
Input Field Description
title - String! The title of the notebook.
blocks - [CreateNotebookBlockInput!]! Array of notebook blocks.
namespace - ID! Notebook namespace (user or org). Controls the visibility of the notebook and who can edit the notebook. Only the notebook creator can update the namespace.
public - Boolean! Public property controls the visibility of the notebook. A public notebook is available to any user on the instance. Private notebooks are only available to their creators.
Example
{
  "title": "abc123",
  "blocks": [CreateNotebookBlockInput],
  "namespace": 4,
  "public": true
}

NotebookStar

Description

A notebook star.

Fields
Field Name Description
user - User! User that starred the notebook.
createdAt - DateTime! Date and time the notebook star was created.
Example
{
  "user": User,
  "createdAt": "2007-12-03T10:15:30Z"
}

NotebookStarConnection

Description

A paginated list of notebook stars.

Fields
Field Name Description
nodes - [NotebookStar!]! A list of notebook stars.
totalCount - Int! The total number of notebook stars in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [NotebookStar],
  "totalCount": 987,
  "pageInfo": PageInfo
}

NotebooksOrderBy

Description

NotebooksOrderBy enumerates the ways notebooks can be ordered.

Values
Enum Value Description

NOTEBOOK_UPDATED_AT

NOTEBOOK_CREATED_AT

NOTEBOOK_STAR_COUNT

Example
"NOTEBOOK_UPDATED_AT"

OnboardingTour

Description

(experimental) Onboarding tour content wrapper object.

Fields
Field Name Description
current - OnboardingTourContent (experimental) The current version of the onboarding tour content.
Example
{"current": OnboardingTourContent}

OnboardingTourContent

Description

(experimental) Content for a specific tour versioned by ID

Fields
Field Name Description
id - ID! (experimental) GraphQL ID of the content tour object.
value - String! (experimental) JSON value of the onboarding content.
Example
{"id": 4, "value": "abc123"}

Org

Description

An organization, which is a group of users.

Fields
Field Name Description
executorSecrets - ExecutorSecretConnection! The list of all available executor secrets for execution in this orgs namespace.
Arguments
scope - ExecutorSecretScope!

The scope for which secrets shall be returned.

first - Int

Only return N records.

after - String

Opaque cursor for pagination.

id - ID! The unique ID for the organization.
name - String! The organization's name. This is unique among all organizations on this Sourcegraph site.
displayName - String The organization's chosen display name.
createdAt - DateTime! The date when the organization was created.
members - NewUsersConnection! A list of users who are members of this organization.
Arguments
first - Int

The limit argument for forward pagination.

last - Int

The limit argument for backward pagination.

after - String

The cursor argument for forward pagination.

before - String

The cursor argument for backward pagination.

query - String

Return users whose usernames or display names match the query.

latestSettings - Settings The latest settings for the organization. Only organization members and site admins can access this field.
settingsCascade - SettingsCascade! All settings for this organization, and the individual levels in the settings cascade (global > organization) that were merged to produce the final merged settings. Only organization members and site admins can access this field.
configurationCascade - ConfigurationCascade! DEPRECATED Use settingsCascade instead. This field is a deprecated alias for it and will be removed in a future release.
viewerPendingInvitation - OrganizationInvitation DEPRECATED A pending invitation for the viewer to join this organization, if any. Use invitationByToken operation instead. This field is deprecated and will be removed in a future release.
viewerCanAdminister - Boolean! Whether the viewer has admin privileges on this organization. Currently, all of an organization's members have admin privileges on the organization.
viewerIsMember - Boolean! Whether the viewer is a member of this organization.
url - String! The URL to the organization.
settingsURL - String The URL to the organization's settings.
namespaceName - String! The name of this user namespace's component. For organizations, this is the organization's name.
batchChanges - BatchChangeConnection! A list of batch changes initially applied in this organization.
Arguments
first - Int

Returns the first n batch changes from the list.

after - String

Opaque pagination cursor.

state - BatchChangeState

Only return batch changes in this state. If states is also specified, it will take precedence over state.

states - [BatchChangeState!]

Only return batch changes in any of these states. If state is also specified, states will take precedence over it.

viewerCanAdminister - Boolean

Only include batch changes that the viewer can administer.

Example
{
  "executorSecrets": ExecutorSecretConnection,
  "id": "4",
  "name": "xyz789",
  "displayName": "xyz789",
  "createdAt": "2007-12-03T10:15:30Z",
  "members": NewUsersConnection,
  "latestSettings": Settings,
  "settingsCascade": SettingsCascade,
  "configurationCascade": ConfigurationCascade,
  "viewerPendingInvitation": OrganizationInvitation,
  "viewerCanAdminister": true,
  "viewerIsMember": false,
  "url": "xyz789",
  "settingsURL": "abc123",
  "namespaceName": "xyz789",
  "batchChanges": BatchChangeConnection
}

OrgConnection

Description

A list of organizations.

Fields
Field Name Description
nodes - [Org!]! A list of organizations.
totalCount - Int! The total count of organizations in the connection. This total count may be larger than the number of nodes in this object when the result is paginated.
Example
{"nodes": [Org], "totalCount": 987}

OrgMembersSummary

Description

Result organization members count and pending invitations count.

Fields
Field Name Description
id - ID! The unique ID for the Org.
membersCount - Int! Total number of members for the org.
invitesCount - Int! Total number of pending invites for the org.
Example
{"id": 4, "membersCount": 987, "invitesCount": 987}

OrganizationInvitation

Description

An invitation to join an organization as a member.

Fields
Field Name Description
id - ID! The ID of the invitation.
organization - Org! The organization that the invitation is for.
sender - User! The user who sent the invitation.
recipient - User The user who received the invitation.
recipientEmail - String The email address that the invitation was sent to.
createdAt - DateTime! The date when this invitation was created.
notifiedAt - DateTime The most recent date when a notification was sent to the recipient about this invitation.
respondedAt - DateTime The date when this invitation was responded to by the recipient.
responseType - OrganizationInvitationResponseType The recipient's response to this invitation, or no response (null).
respondURL - String The URL where the recipient can respond to the invitation when pending, or null if not pending.
revokedAt - DateTime The date when this invitation was revoked.
expiresAt - DateTime The date when this invitation is going to expire.
isVerifiedEmail - Boolean Boolean flag which returns true if the email on the invite matches a verified email of the user
Example
{
  "id": 4,
  "organization": Org,
  "sender": User,
  "recipient": User,
  "recipientEmail": "xyz789",
  "createdAt": "2007-12-03T10:15:30Z",
  "notifiedAt": "2007-12-03T10:15:30Z",
  "respondedAt": "2007-12-03T10:15:30Z",
  "responseType": "ACCEPT",
  "respondURL": "xyz789",
  "revokedAt": "2007-12-03T10:15:30Z",
  "expiresAt": "2007-12-03T10:15:30Z",
  "isVerifiedEmail": true
}

OrganizationInvitationResponseType

Description

The recipient's possible responses to an invitation to join an organization as a member.

Values
Enum Value Description

ACCEPT

The invitation was accepted by the recipient.

REJECT

The invitation was rejected by the recipient.
Example
"ACCEPT"

OrganizationMembership

Description

An organization membership.

Fields
Field Name Description
organization - Org! The organization.
user - User! The user.
createdAt - DateTime! The time when this was created.
updatedAt - DateTime! The time when this was updated.
Example
{
  "organization": Org,
  "user": User,
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z"
}

OrganizationMembershipConnection

Description

A list of organization memberships.

Fields
Field Name Description
nodes - [OrganizationMembership!]! A list of organization memberships.
totalCount - Int! The total count of organization memberships in the connection. This total count may be larger than the number of nodes in this object when the result is paginated.
Example
{"nodes": [OrganizationMembership], "totalCount": 987}

OutOfBandMigration

Description

An out-of-band migration is a process that runs in the background of the instance that moves data from one format into another format. Out-of-band migrations

Fields
Field Name Description
id - ID! The unique identifier of this migration.
team - String! The team that owns this migration (e.g., code-intelligence).
component - String! The component this migration affects (e.g., codeintel-db.lsif_data_documents).
description - String! A human-readable summary of the migration.
introduced - String!

The Sourcegraph version in which this migration was introduced. The format of this version includes only major and minor parts separated by a dot. The patch version can always be assumed to be zero as we'll never introduce or deprecate an out-of-band migration within a patch release.

It is necessary to completely this migration in reverse (if destructive) before downgrading to or past this version. Otherwise, the previous instance version will not be aware of the new data format.

deprecated - String

The Sourcegraph version by which this migration is assumed to have completed. The format of this version mirrors introduced and includes only major and minor parts separated by a dot.

It is necessary to have completed this migration before upgrading to or past this version. Otherwise, the next instance version will no longer be aware of the old data format.

progress - Float! The progress of the migration (in the forward direction). In the range [0, 1].
created - DateTime! The time the migration record was inserted.
lastUpdated - DateTime The last time the migration progress or error list was updated.
nonDestructive - Boolean! If false, the migration moves data destructively, and a previous version of Sourcegraph will encounter errors when interfacing with the target data unless the migration is first run in reverse prior to a downgrade.
applyReverse - Boolean! If true, the migration will run in reverse.
errors - [OutOfBandMigrationError!]! A list of errors that have occurred while performing this migration (in either direction). This list is bounded by a maximum size, and older errors will replaced by newer errors as the list capacity is reached.
Example
{
  "id": 4,
  "team": "xyz789",
  "component": "abc123",
  "description": "abc123",
  "introduced": "xyz789",
  "deprecated": "abc123",
  "progress": 123.45,
  "created": "2007-12-03T10:15:30Z",
  "lastUpdated": "2007-12-03T10:15:30Z",
  "nonDestructive": true,
  "applyReverse": true,
  "errors": [OutOfBandMigrationError]
}

OutOfBandMigrationError

Description

An error that occurred while performing an out-of-band migration.

Fields
Field Name Description
message - String! The error message.
created - DateTime! The time the error occurred.
Example
{
  "message": "xyz789",
  "created": "2007-12-03T10:15:30Z"
}

OutboundRequest

Description

A single outbound request.

Fields
Field Name Description
id - ID! The request log item ID.
startedAt - DateTime! The time the request was sent at.
method - String! The method used in the HTTP request. E.g. GET, POST, etc.
url - String! The full URL the request was sent to.
requestHeaders - [HTTPHeader!]! The headers sent with the HTTP request.
requestBody - String! The body content of the HTTP message.
statusCode - Int! The HTTP status code received.
responseHeaders - [HTTPHeader!]! The headers received with the HTTP response.
durationMs - Int! The total time the request took to complete, in milliseconds.
errorMessage - String! Any error message got from the request Doer in case of an error, otherwise an empty string.
creationStackFrame - String! Stack information to figure out where the ExternalClientFactory was created.
callStack - String! Stack information to figure out where in the code base the request was initiated.
Example
{
  "id": "4",
  "startedAt": "2007-12-03T10:15:30Z",
  "method": "xyz789",
  "url": "xyz789",
  "requestHeaders": [HTTPHeader],
  "requestBody": "abc123",
  "statusCode": 123,
  "responseHeaders": [HTTPHeader],
  "durationMs": 123,
  "errorMessage": "abc123",
  "creationStackFrame": "abc123",
  "callStack": "xyz789"
}

OutboundRequestConnection

Description

A list of logged outbound requests.

Fields
Field Name Description
nodes - [OutboundRequest!]! A list of outbound requests.
totalCount - Int! The total number of outbound request log items in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [OutboundRequest],
  "totalCount": 123,
  "pageInfo": PageInfo
}

OutboundWebhook

Description

An outbound webhook registered within Sourcegraph.

Fields
Field Name Description
id - ID! The outbound webhook ID.
url - String! The outbound webhook URL.
eventTypes - [OutboundWebhookScopedEventType]! The event types that the outbound webhook will receive.
stats - OutboundWebhookLogStats! Stats on the payloads dispatched to this outbound webhook within the webhook log retention period.
logs - OutboundWebhookLogConnection!

Logged payloads sent to this outbound webhook, optionally filtered by error state. Logs are considered "errored" when either a network error occurred while dispatching the payload, or when a HTTP response outside the range [100, 399].

Logs will be returned in time order, from newest to oldest.

Arguments
first - Int
after - String
onlyErrors - Boolean
Example
{
  "id": "4",
  "url": "abc123",
  "eventTypes": [OutboundWebhookScopedEventType],
  "stats": OutboundWebhookLogStats,
  "logs": OutboundWebhookLogConnection
}

OutboundWebhookConnection

Description

A list of outbound webhooks.

Fields
Field Name Description
nodes - [OutboundWebhook!]! The outbound webhooks in the current page.
totalCount - Int! The total number of matching outbound webhooks.
pageInfo - PageInfo! Connection page metadata.
Example
{
  "nodes": [OutboundWebhook],
  "totalCount": 987,
  "pageInfo": PageInfo
}

OutboundWebhookCreateInput

Description

Input for the createOutboundWebhook mutation.

Fields
Input Field Description
url - String! The outbound webhook URL.
secret - String! The secret shared with the outbound webhook.
eventTypes - [OutboundWebhookScopedEventTypeInput!]!

The event types the outbound webhook will receive.

At least one event type must be provided.

Example
{
  "url": "xyz789",
  "secret": "xyz789",
  "eventTypes": [OutboundWebhookScopedEventTypeInput]
}

OutboundWebhookEventType

Description

An event type that a webhook can be registered to be notified of.

Fields
Field Name Description
key - String! The event type key, as used when constructing OutboundWebhookScopedEventTypeInput instances and as returned in OutboundWebhook.eventTypes.
description - String! A human readable description of the event type.
Example
{
  "key": "xyz789",
  "description": "xyz789"
}

OutboundWebhookJob

Description

An outbound webhook job, which singularly represents an individual event that may generate one or more webhook payloads.

Fields
Field Name Description
id - ID! The outbound webhook job ID.
eventType - String! The event type.
scope - String The scope. Currently unused.
payload - String! The payload sent to each outbound webhook registered for this event type.
Example
{
  "id": 4,
  "eventType": "abc123",
  "scope": "xyz789",
  "payload": "abc123"
}

OutboundWebhookLog

Description

A single logged request sent to an outbound webhook.

Fields
Field Name Description
id - ID! The log ID.
job - OutboundWebhookJob! The outbound webhook job that triggered the request.
sentAt - DateTime! When the request was sent.
statusCode - Int! The status code returned from the outbound webhook, or 0 if a network error occurred.
request - WebhookLogRequest! The request sent to the outbound webhook.
response - WebhookLogResponse The response received from the outbound webhook, or null if no response was received due to a network error.
error - String The error message if a network error occurred.
Example
{
  "id": "4",
  "job": OutboundWebhookJob,
  "sentAt": "2007-12-03T10:15:30Z",
  "statusCode": 987,
  "request": WebhookLogRequest,
  "response": WebhookLogResponse,
  "error": "abc123"
}

OutboundWebhookLogConnection

Description

A list of outbound webhook logs.

Fields
Field Name Description
nodes - [OutboundWebhookLog!]! The logs in the current page.
totalCount - Int! The total number of matching outbound webhook logs.
pageInfo - PageInfo! Connection page metadata.
Example
{
  "nodes": [OutboundWebhookLog],
  "totalCount": 987,
  "pageInfo": PageInfo
}

OutboundWebhookLogStats

Description

Stats on outbound webhook logs.

Fields
Field Name Description
total - Int! The total number of webhook payloads logged over the webhook log retention period.
errored - Int! The total number of webhook payloads logged over the webhook log retention period that resulted in errors from the webhook.
Example
{"total": 123, "errored": 123}

OutboundWebhookScopedEventType

Description

An event type an outbound webhook has opted to receive.

Fields
Field Name Description
eventType - String! The event type, which must match a key returned from outboundWebhookEventTypes.
scope - String

An optional scope for the event type.

Currently unused.

Example
{
  "eventType": "abc123",
  "scope": "abc123"
}

OutboundWebhookScopedEventTypeInput

Description

Event type input for the outbound webhook mutations.

Fields
Input Field Description
eventType - String! The event type, which must match a key returned from outboundWebhookEventTypes.
scope - String

An optional scope for the event type.

Currently unused.

Example
{
  "eventType": "xyz789",
  "scope": "xyz789"
}

OutboundWebhookUpdateInput

Description

Input for the updateOutboundWebhook mutation.

Fields
Input Field Description
url - String! The outbound webhook URL.
eventTypes - [OutboundWebhookScopedEventTypeInput!]!

The event types the outbound webhook will receive. This list replaces the event types previously registered on the webhook.

At least one event type must be provided.

Example
{
  "url": "xyz789",
  "eventTypes": [OutboundWebhookScopedEventTypeInput]
}

OwnSignalConfiguration

Description

OwnSignalConfiguration represents the configuration for an ownership signal.

Fields
Field Name Description
name - String! The name of the signal configuration, this serves as the primary key.
description - String! The description of the signal configuration.
isEnabled - Boolean! Whether or not the signal configuration is enabled.
excludedRepoPatterns - [String!]! A list of repository name patterns to exclude from the signal.
Example
{
  "name": "xyz789",
  "description": "xyz789",
  "isEnabled": false,
  "excludedRepoPatterns": ["xyz789"]
}

OwnSignalConfigurationUpdate

Description

OwnSignalConfigurationUpdate represents an update to an OwnSignalConfiguration.

Fields
Input Field Description
excludedRepoPatterns - [String!]! A list of repository name patterns to exclude from the signal.
enabled - Boolean! Whether or not the signal configuration should be enabled.
name - String! The new name for the signal configuration.
Example
{
  "excludedRepoPatterns": ["xyz789"],
  "enabled": true,
  "name": "xyz789"
}

Ownable

Description

Ownables are resources that can have ownership information attached.

Fields
Field Name Description
ownership - OwnershipConnection! Ownership summary for this entity.
Arguments
first - Int

Returns the first n ownership records from the list.

after - String

Opaque pagination cursor.

reasons - [OwnershipReasonType!]

Return only ownership for the given reasons.

Possible Types
Ownable Types

GitBlob

Example
{"ownership": OwnershipConnection}

Owner

Description

An owner is any entity that can own other resources.

Types
Union Types

Person

Team

Example
Person

Ownership

Description

Ownership is the collection of data points that make Sourcegraph suggest the contained owner as owner of the Ownable this is attached to.

Fields
Field Name Description
owner - Owner! The owner this entry refers to. Can be a person or a team.
reasons - [OwnershipReason!]! The reasons why Sourcegraph determined this entity as an owner.
Example
{
  "owner": Person,
  "reasons": [CodeownersFileEntry]
}

OwnershipConnection

Description

A list of ownership entries.

Fields
Field Name Description
totalCount - Int! The total count of items in the connection.
totalOwners - Int! The total number of owners in this connection. Here an owner is as opposed to an ownership inference signal.
pageInfo - PageInfo! The pagination info for the connection.
nodes - [Ownership!]! The page set of Ownership entries in this connection.
Example
{
  "totalCount": 123,
  "totalOwners": 123,
  "pageInfo": PageInfo,
  "nodes": [Ownership]
}

OwnershipReason

Description

A union of all the different ownership reasons.

Example
CodeownersFileEntry

OwnershipReasonType

Description

The only way we can recognize ownership at this point is through CODEOWNERS file entry.

Values
Enum Value Description

CODEOWNERS_FILE_ENTRY

ASSIGNED_OWNER

RECENT_CONTRIBUTOR_OWNERSHIP_SIGNAL

RECENT_VIEW_OWNERSHIP_SIGNAL

Example
"CODEOWNERS_FILE_ENTRY"

OwnershipStats

Description

Statistics about code ownership computed for given context (usually a repository or directory).

Fields
Field Name Description
totalFiles - Int! Total files considered for ownership statistics (owned + unowned).
totalCodeownedFiles - Int! Total files with ownership stemming from CODEOWNERS files.
totalOwnedFiles - Int! Total files with any ownership defined (both CODEOWNERS and assigned).
totalAssignedOwnershipFiles - Int! Total files with assigned ownership.
updatedAt - DateTime When statistics were last updated.
Example
{
  "totalFiles": 123,
  "totalCodeownedFiles": 987,
  "totalOwnedFiles": 987,
  "totalAssignedOwnershipFiles": 987,
  "updatedAt": "2007-12-03T10:15:30Z"
}

PackageFilter

Description

Filters package repo references of the matching scheme/kind, applying to either references of matching names or versions of a specific package name. One of either nameFilter or versionFilter must be provided.

Fields
Field Name Description
id - ID! Opaque ID string.
behaviour - PackageMatchBehaviour! The behaviour of the filter when applied to a matching package repo reference or version.
kind - PackageRepoReferenceKind! The schemes/kinds of package repo references this filter should apply to only.
nameFilter - PackageNameFilter Optional name-matching filter.
versionFilter - PackageVersionFilter Optional package-specific version-matching filter.
Example
{
  "id": "4",
  "behaviour": "BLOCK",
  "kind": "GOMODULES",
  "nameFilter": PackageNameFilter,
  "versionFilter": PackageVersionFilter
}

PackageMatchBehaviour

Description

Whether a package repo reference filter is part of the allowlist or blocklist

Values
Enum Value Description

BLOCK

Blocks a package repo reference from syncing.

ALLOW

Allows a package repo reference to be synced.
Example
"BLOCK"

PackageNameFilter

Description

A package repo reference filter that matches names.

Fields
Field Name Description
packageGlob - String! Glob string to match names.
Example
{"packageGlob": "xyz789"}

PackageNameFilterInput

Description

A package repo reference filter that matches names.

Fields
Input Field Description
packageGlob - String! Glob string to match names.
Example
{"packageGlob": "xyz789"}

PackageRepoOrVersionConnection

Description

Connection resolver for either a list of package repo references or versions.

Example
PackageRepoReferenceConnection

PackageRepoReference

Description

A reference to a package repo, such as a maven artifact, rust crate etc.

Fields
Field Name Description
id - ID! A unique ID for the package repo reference.
kind - PackageRepoReferenceKind! The external service kind under which this package repo reference is uniquely identified.
name - String! The name of the package, in a format relevant to the specific ecosystem e.g. maven artifact coordinates (com.sample:text), npm scoped packages (@monkeys/banana).
versions - [PackageRepoReferenceVersion!]! The versions of this package known to the sourcegraph instance.
blocked - Boolean! Indicates whether a package repo reference has been blocked by a blocklist entry and/or no matching entry in a non-empty allowlist
repository - Repository The synthetic repository (aka the package repo) created to store the contents of the synced versions of the package repo reference. This type is subject to change once package repos and other non-git code hosts become first-class.
Example
{
  "id": "4",
  "kind": "GOMODULES",
  "name": "abc123",
  "versions": [PackageRepoReferenceVersion],
  "blocked": false,
  "repository": Repository
}

PackageRepoReferenceConnection

Description

List of package repo references.

Fields
Field Name Description
nodes - [PackageRepoReference!]! A list of package repo references.
totalCount - Int! The total number of package repo references in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [PackageRepoReference],
  "totalCount": 987,
  "pageInfo": PageInfo
}

PackageRepoReferenceKind

Description

A kind of package repo reference. ExternalServiceKind, with a more specific set of values.

Values
Enum Value Description

GOMODULES

JVMPACKAGES

NPMPACKAGES

PYTHONPACKAGES

RUSTPACKAGES

RUBYPACKAGES

Example
"GOMODULES"

PackageRepoReferenceVersion

Description

A version of a package repo reference.

Fields
Field Name Description
id - ID! A unique ID for the package repo reference version.
packageRepoReferenceID - ID! The package repo reference that this ID is for.
version - String! The version string. Not guaranteed to be semver or any other format.
Example
{
  "id": "4",
  "packageRepoReferenceID": 4,
  "version": "abc123"
}

PackageRepoReferenceVersionConnection

Description

List of package repo reference versions.

Fields
Field Name Description
nodes - [PackageRepoReferenceVersion!]! A list of package repo versions.
totalCount - Int! The total number of package repo versions in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [PackageRepoReferenceVersion],
  "totalCount": 123,
  "pageInfo": PageInfo
}

PackageVersionFilter

Description

A package repo reference filter that matches versions for a specific name.

Fields
Field Name Description
packageName - String! Exact package name to match.
versionGlob - String! Glob string to match versions.
Example
{
  "packageName": "xyz789",
  "versionGlob": "xyz789"
}

PackageVersionFilterInput

Description

A package repo reference filter that matches versions for a specific name.

Fields
Input Field Description
packageName - String! Exact package name to match.
versionGlob - String! Glob string to match versions.
Example
{
  "packageName": "xyz789",
  "versionGlob": "xyz789"
}

PackageVersionOrNameFilterInput

Description

A name or version matching filter for. One of either nameFilter or versionFilter must be provided.

Fields
Input Field Description
nameFilter - PackageNameFilterInput Optional name-matching filter.
versionFilter - PackageVersionFilterInput Optional package-specific version-matching filter.
Example
{
  "nameFilter": PackageNameFilterInput,
  "versionFilter": PackageVersionFilterInput
}

PageInfo

Description

Pagination information for forward-only pagination. See https://facebook.github.io/relay/graphql/connections.htm#sec-undefined.PageInfo.

Fields
Field Name Description
endCursor - String When paginating forwards, the cursor to continue.
hasNextPage - Boolean! When paginating forwards, are there more items?
Example
{
  "endCursor": "xyz789",
  "hasNextPage": false
}

ParentSourcegraphDetails

Description

Parent Sourcegraph instance

Fields
Field Name Description
url - String! Sourcegraph instance URL.
Example
{"url": "xyz789"}

PerforceChangelist

Description

EXPERIMENTAL: A Perforce changelist.

Fields
Field Name Description
cid - String! The changelist ID.
canonicalURL - String! The canonical URL to this changelist.
commit - GitCommit! The corresponding git commit of this changelist.
Example
{
  "cid": "abc123",
  "canonicalURL": "xyz789",
  "commit": GitCommit
}

Permission

Description

A permission

Fields
Field Name Description
id - ID! The globally unique identifier for this permission.
namespace - PermissionNamespace! The namespace in which this permission belongs to.
action - String! The unique action which is granted to a bearer of this permission.
displayName - String! A unique, human-readable string used to represent a permission, taking the form: :#@<user_id | user_group>
createdAt - DateTime! The date and time when the permission was created.
Example
{
  "id": "4",
  "namespace": "BATCH_CHANGES",
  "action": "abc123",
  "displayName": "abc123",
  "createdAt": "2007-12-03T10:15:30Z"
}

PermissionConnection

Description

A list of permissions.

Fields
Field Name Description
nodes - [Permission!]! A list of permissions.
totalCount - Int! The total count of permissions in the connection.
pageInfo - ConnectionPageInfo! Pagination information.
Example
{
  "nodes": [Permission],
  "totalCount": 123,
  "pageInfo": ConnectionPageInfo
}

PermissionNamespace

Description

A namespace represents a distinct context within which permission policies are defined and enforced.

Values
Enum Value Description

BATCH_CHANGES

This represents the Batch Changes namespace.

OWNERSHIP

Code ownership namespace used for permitting to assign ownership within Sourcegraph.

REPO_METADATA

Repo Metadata namespace used for permitting to edit repository key-value pair metadata.

CODY

This represents the Cody namespace.
Example
"BATCH_CHANGES"

Person

Description

A person.

Fields
Field Name Description
name - String! The name.
email - String! The email.
displayName - String! The name if set; otherwise the email username.
avatarURL - String The avatar URL, if known.
user - User The corresponding user account for this person, if one exists.
Example
{
  "name": "abc123",
  "email": "xyz789",
  "displayName": "abc123",
  "avatarURL": "abc123",
  "user": User
}

PhabricatorRepo

Description

A Phabricator repository.

Fields
Field Name Description
name - String! The canonical repo name (e.g. "github.com/gorilla/mux").
uri - String! An alias for name. use name instead
callsign - String! The unique Phabricator identifier for the repo, like "MUX"
url - String! The URL to the phabricator instance (e.g. http://phabricator.sgdev.org)
Example
{
  "name": "xyz789",
  "uri": "xyz789",
  "callsign": "xyz789",
  "url": "abc123"
}

PieChartInsightViewPresentation

Description

View presentation for an insight pie chart.

Fields
Field Name Description
title - String! The title for the pie chart.
otherThreshold - Float! The threshold for which groups fall into the "other category". Only categories with a percentage greater than this value will be separately rendered.
Example
{
  "title": "xyz789",
  "otherThreshold": 123.45
}

PieChartOptionsInput

Description

Options for a pie chart

Fields
Input Field Description
title - String! The title for the pie chart.
otherThreshold - Float! The threshold for which groups fall into the "other category". Only categories with a percentage greater than this value will be separately rendered.
Example
{
  "title": "xyz789",
  "otherThreshold": 987.65
}

PieChartSearchInsightInput

Description

Input for a pie chart search insight

Fields
Input Field Description
query - String! The query string.
repositoryScope - RepositoryScopeInput! The scope of repositories.
presentationOptions - PieChartOptionsInput! Options for this pie chart.
dashboards - [ID!] The dashboard IDs to associate this insight with once created.
Example
{
  "query": "xyz789",
  "repositoryScope": RepositoryScopeInput,
  "presentationOptions": PieChartOptionsInput,
  "dashboards": ["4"]
}

Position

Description

A zero-based position inside a file.

Fields
Field Name Description
line - Int! The line number (zero-based) of the position.
character - Int! The character offset (zero-based) in the line of the position.
Example
{"line": 123, "character": 987}

PreIndexStep

Description

The configuration and execution summary of a step to be performed prior to indexing.

Fields
Field Name Description
root - String! The working directory relative to the cloned repository root.
image - String! The name of the Docker image to run.
commands - [String!]! The arguments to supply to the Docker container's entrypoint.
logEntry - ExecutionLogEntry The execution summary (if completed or errored) of the docker command.
Example
{
  "root": "abc123",
  "image": "abc123",
  "commands": ["abc123"],
  "logEntry": ExecutionLogEntry
}

PreciseIndex

Description

Metadata and status about a precise code intelligence index.

Fields
Field Name Description
id - ID! The ID.
projectRoot - CodeIntelGitTree The project for which this index provides code intelligence.
inputCommit - String! The original 40-character commit commit supplied at creation.
inputRoot - String! The original root supplied at creation.
inputIndexer - String! The original indexer name supplied at creation.
tags - [String!]! The tags, if any, associated with this commit.
indexer - CodeIntelIndexer The indexer used to produce this index.
state - PreciseIndexState! The current state.
queuedAt - DateTime The time the index was queued for indexing.
indexingStartedAt - DateTime The time the index job started running.
indexingFinishedAt - DateTime The time the index job stopped running.
uploadedAt - DateTime The time the index data file was uploaded.
processingStartedAt - DateTime The time the upload data file started being processed.
processingFinishedAt - DateTime The time the upload data file stopped being processed.
failure - String The indexing or processing error message.
placeInQueue - Int The rank of this index job or processing job in its respective queue.
steps - IndexSteps The configuration and execution summary (if completed or errored) of this index job.
shouldReindex - Boolean! If set, this index has been marked as replaceable by a new auto-indexing job.
isLatestForRepo - Boolean! Whether or not this index provides intelligence for the tip of the default branch. Find reference queries will return symbols from remote repositories only when this property is true. This property is updated asynchronously and is eventually consistent with the git data known by the instance.
retentionPolicyOverview - CodeIntelligenceRetentionPolicyMatchesConnection! The list of retention policies associated with this index.
Arguments
matchesOnly - Boolean!
query - String
after - String
first - Int
auditLogs - [LSIFUploadAuditLog!] Audit logs representing each state change of the upload in order from earliest to latest.
Example
{
  "id": 4,
  "projectRoot": CodeIntelGitTree,
  "inputCommit": "abc123",
  "inputRoot": "abc123",
  "inputIndexer": "abc123",
  "tags": ["xyz789"],
  "indexer": CodeIntelIndexer,
  "state": "UPLOADING_INDEX",
  "queuedAt": "2007-12-03T10:15:30Z",
  "indexingStartedAt": "2007-12-03T10:15:30Z",
  "indexingFinishedAt": "2007-12-03T10:15:30Z",
  "uploadedAt": "2007-12-03T10:15:30Z",
  "processingStartedAt": "2007-12-03T10:15:30Z",
  "processingFinishedAt": "2007-12-03T10:15:30Z",
  "failure": "xyz789",
  "placeInQueue": 123,
  "steps": IndexSteps,
  "shouldReindex": true,
  "isLatestForRepo": true,
  "retentionPolicyOverview": CodeIntelligenceRetentionPolicyMatchesConnection,
  "auditLogs": [LSIFUploadAuditLog]
}

PreciseIndexConnection

Description

A list of precise code intelligence indexes.

Fields
Field Name Description
nodes - [PreciseIndex!]! The current page of indexes.
totalCount - Int The total number of results (over all pages) in this list.
pageInfo - PageInfo! Metadata about the current page of results.
Example
{
  "nodes": [PreciseIndex],
  "totalCount": 987,
  "pageInfo": PageInfo
}

PreciseIndexState

Description

Possible states for PreciseIndexes.

Values
Enum Value Description

UPLOADING_INDEX

QUEUED_FOR_PROCESSING

PROCESSING

PROCESSING_ERRORED

COMPLETED

DELETING

DELETED

QUEUED_FOR_INDEXING

INDEXING

INDEXING_ERRORED

INDEXING_COMPLETED

Example
"UPLOADING_INDEX"

PreviewRepositoryComparison

Description

A not-yet-committed preview of a diff on a repository.

Fields
Field Name Description
baseRepository - Repository! The repository that is the base (left-hand side) of this comparison.
fileDiffs - FileDiffConnection! The file diffs for each changed file.
Arguments
first - Int

Return the first n file diffs from the list.

after - String

Return file diffs after the given cursor.

paths - [String!]

A list of paths or directories used to filter the diffs

Example
{
  "baseRepository": Repository,
  "fileDiffs": FileDiffConnection
}

ProductLicense

Description

A product license that was created on Sourcegraph.com. FOR INTERNAL USE ONLY.

Fields
Field Name Description
id - ID! The unique ID of this product license.
subscription - ProductSubscription! The product subscription associated with this product license.
info - ProductLicenseInfo Information about this product license.
licenseKey - String! The license key.
siteID - String Site ID of the instance that uses the license.
createdAt - DateTime! The date when this product license was created.
revokedAt - DateTime The date when this product license was revoked.
revokeReason - String The reason for revoking product license.
version - Int! The version of the license.
Example
{
  "id": "4",
  "subscription": ProductSubscription,
  "info": ProductLicenseInfo,
  "licenseKey": "abc123",
  "siteID": "xyz789",
  "createdAt": "2007-12-03T10:15:30Z",
  "revokedAt": "2007-12-03T10:15:30Z",
  "revokeReason": "abc123",
  "version": 987
}

ProductLicenseConnection

Description

A list of product licenses. FOR INTERNAL USE ONLY.

Fields
Field Name Description
nodes - [ProductLicense!]! A list of product licenses.
totalCount - Int! The total count of product licenses in the connection. This total count may be larger than the number of nodes in this object when the result is paginated.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [ProductLicense],
  "totalCount": 123,
  "pageInfo": PageInfo
}

ProductLicenseInfo

Description

Information about this site's product license (which activates certain Sourcegraph features).

Fields
Field Name Description
productNameWithBrand - String! The full name of the product that this license is for. To get the product name for the current Sourcegraph site, use ProductSubscriptionStatus.productNameWithBrand instead (to handle cases where there is no license).
isFreePlan - Boolean! True if the license is for a free plan.
tags - [String!]! Tags indicating the product plan and features activated by this license.
userCount - Int! The number of users allowed by this license.
expiresAt - DateTime! The date when this license expires.
salesforceSubscriptionID - String The Salesforce subscription ID associated with this license.
salesforceOpportunityID - String The Salesforce opportunity ID associated with this license.
isValid - Boolean!

This indicates if the current license is valid. It will be false if:

  • The license key has expired
  • The license key is in use on another instance
  • The license key was revoked
licenseInvalidityReason - String This indicates the reason the license is invalid. It'll be null if isValid is true.
hashedKey - String The license key, hashed using sha256.
Example
{
  "productNameWithBrand": "xyz789",
  "isFreePlan": true,
  "tags": ["abc123"],
  "userCount": 123,
  "expiresAt": "2007-12-03T10:15:30Z",
  "salesforceSubscriptionID": "abc123",
  "salesforceOpportunityID": "abc123",
  "isValid": true,
  "licenseInvalidityReason": "abc123",
  "hashedKey": "abc123"
}

ProductLicenseInput

Description

An input type that describes a product license to be generated and signed. FOR INTERNAL USE ONLY.

Fields
Input Field Description
tags - [String!]! The tags that indicate which features are activated by this license.
userCount - Int! The number of users for which this product subscription is valid.
expiresAt - Int! The expiration date of this product license, expressed as the number of seconds since the epoch.
salesforceSubscriptionID - String The Salesforce subscription ID associated with this product license.
salesforceOpportunityID - String The Salesforce opportunity ID associated with this product license.
Example
{
  "tags": ["abc123"],
  "userCount": 123,
  "expiresAt": 987,
  "salesforceSubscriptionID": "xyz789",
  "salesforceOpportunityID": "xyz789"
}

ProductSubscription

Description

A product subscription that was created on Sourcegraph.com. FOR INTERNAL USE ONLY.

Fields
Field Name Description
id - ID! The unique ID of this product subscription.
uuid - String! The unique UUID of this product subscription. Unlike ProductSubscription.id, this does not encode the type and is not a GraphQL node ID.
name - String! A name for the product subscription derived from its ID. The name is not guaranteed to be unique.
account - User The user (i.e., customer) to whom this subscription is granted, or null if the account has been deleted.
activeLicense - ProductLicense The currently active product license associated with this product subscription, if any.
productLicenses - ProductLicenseConnection! A list of product licenses associated with this product subscription. Only Sourcegraph.com site admins may list inactive product licenses (other viewers should use ProductSubscription.activeLicense).
Arguments
first - Int

Returns the first n product licenses from the list.

currentSourcegraphAccessToken - String The most preferable Sourcegraph access token to use for authenticating as the subscription holder with managed Sourcegraph services. Null only if creating a token failed, for example when no active license exists.
sourcegraphAccessTokens - [String!]! Available access tokens for authenticating as the subscription holder with managed Sourcegraph services.
codyGatewayAccess - CodyGatewayAccess! Cody Gateway access granted to this subscription. Properties may be inferred from the active license, or be defined in overrides.
createdAt - DateTime! The date when this product subscription was created.
isArchived - Boolean! Whether this product subscription was archived.
url - String! The URL to view this product subscription.
urlForSiteAdmin - String The URL to view this product subscription in the site admin area. Only Sourcegraph.com site admins may query this field.
Example
{
  "id": 4,
  "uuid": "abc123",
  "name": "abc123",
  "account": User,
  "activeLicense": ProductLicense,
  "productLicenses": ProductLicenseConnection,
  "currentSourcegraphAccessToken": "abc123",
  "sourcegraphAccessTokens": ["abc123"],
  "codyGatewayAccess": CodyGatewayAccess,
  "createdAt": "2007-12-03T10:15:30Z",
  "isArchived": false,
  "url": "abc123",
  "urlForSiteAdmin": "abc123"
}

ProductSubscriptionConnection

Description

A list of product subscriptions. FOR INTERNAL USE ONLY.

Fields
Field Name Description
nodes - [ProductSubscription!]! A list of product subscriptions.
totalCount - Int! The total count of product subscriptions in the connection. This total count may be larger than the number of nodes in this object when the result is paginated.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [ProductSubscription],
  "totalCount": 987,
  "pageInfo": PageInfo
}

ProductSubscriptionStatus

Description

Information about this site's product subscription (which enables access to and renewals of a product license).

Fields
Field Name Description
productNameWithBrand - String! The full name of the product in use, such as "Sourcegraph Enterprise".
actualUserCount - Int! The max number of user accounts that have been active on this Sourcegraph site for the current license. If no license is in use, returns zero.
actualUserCountDate - String! The date and time when the max number of user accounts that have been active on this Sourcegraph site for the current license was reached. If no license is in use, returns an empty string.
maximumAllowedUserCount - Int The number of users allowed. If there is a license, this is equal to ProductLicenseInfo.userCount. Otherwise, it is the user limit for instances without a license, or null if there is no limit.
noLicenseWarningUserCount - Int The number of free users allowed on a site without a license before a warning is shown to all users, or null if a valid license is in use.
license - ProductLicenseInfo! The product license associated with this subscription. If no license key is applied, a free plan is assumed.
Example
{
  "productNameWithBrand": "xyz789",
  "actualUserCount": 123,
  "actualUserCountDate": "xyz789",
  "maximumAllowedUserCount": 123,
  "noLicenseWarningUserCount": 987,
  "license": ProductLicenseInfo
}

PublicExternalAccountData

Description

Public provider-specific data about the external account.

Fields
Field Name Description
displayName - String The text name the user is using on the external account, if any.
login - String The login or username the user is using on the external account, if any.
url - String Link to the user profile page for the external account.
Example
{
  "displayName": "abc123",
  "login": "abc123",
  "url": "abc123"
}

PublishedValue

Description

A quadruple that represents all possible states of the published value: true, false, 'draft', or null.

Example
PublishedValue

QueryBlock

Description

Query block allows performing inline search queries within a notebook.

Fields
Field Name Description
id - String! ID of the block.
queryInput - String! A Sourcegraph search query string.
Example
{
  "id": "abc123",
  "queryInput": "abc123"
}

RandomizeUserPasswordResult

Description

The result for Mutation.randomizeUserPassword.

Fields
Field Name Description
resetPasswordURL - String

The reset password URL that the user must visit to sign into their account again. If the builtin username-password authentication provider is not enabled, this field's value is null.

If email sending (SMTP) is configured on this instance, an email containing this URL will also be sent to the primary email address associated with the user.

emailSent - Boolean! If true, then an email with the password reset URL was sent to the primary email address associated with the user. If false, email sending (SMTP) might not be configured on this instance, or an error may have occurred - check the error logs with log scope 'randomizeUserPassword' for more details.
Example
{
  "resetPasswordURL": "xyz789",
  "emailSent": true
}

Range

Description

A range inside a file. The start position is inclusive, and the end position is exclusive.

Fields
Field Name Description
start - Position! The start position of the range (inclusive).
end - Position! The end position of the range (exclusive).
Example
{"start": Position, "end": Position}

RankingSummary

Description

Summary of one precise ranking job.

Fields
Field Name Description
graphKey - String! Identifier of the current ranking job. Corresponds to values in the site configuration.
visibleToZoekt - Boolean! True if the output of this ranking job is currently visible to the Zoekt indexserver.
pathMapperProgress - RankingSummaryProgress! Progress of the path mapping stage.
referenceMapperProgress - RankingSummaryProgress! Progress of the reference mapping stage.
reducerProgress - RankingSummaryProgress Progress of the reducer stage.
Example
{
  "graphKey": "xyz789",
  "visibleToZoekt": false,
  "pathMapperProgress": RankingSummaryProgress,
  "referenceMapperProgress": RankingSummaryProgress,
  "reducerProgress": RankingSummaryProgress
}

RankingSummaryProgress

Description

Progress of one stage of a precise ranking job.

Fields
Field Name Description
startedAt - DateTime! When the job started.
completedAt - DateTime When the job completed (if finished).
processed - Int! How many records have been processed.
total - Int! How many total items will be processed.
Example
{
  "startedAt": "2007-12-03T10:15:30Z",
  "completedAt": "2007-12-03T10:15:30Z",
  "processed": 123,
  "total": 987
}

RateLimiterState

Description

The current state of a rate limiter.

Fields
Field Name Description
burst - Int! The number of tokens in the bucket.
currentCapacity - Int! The current capacity of the rate limiter.
infinite - Boolean! If infinite is true, the rate limiter is functionally disabled.
interval - Int! The amount of time in seconds it takes for the rate limiter to refill the number of tokens specified by limit.
lastReplenishment - DateTime! The last time at which the rate limiter refilled tokens.
limit - Int! The number of tokens the rate limiter refills in the specified amount of time.
Example
{
  "burst": 123,
  "currentCapacity": 123,
  "infinite": true,
  "interval": 987,
  "lastReplenishment": "2007-12-03T10:15:30Z",
  "limit": 123
}

RecentContributorOwnershipSignal

Description

A signal derived from recent code contributors.

Fields
Field Name Description
title - String! Descriptive title to display in the UI for the determination.
description - String! More detailed description to display in the UI for the determination.
Example
{
  "title": "abc123",
  "description": "abc123"
}

RecentViewOwnershipSignal

Description

A signal derived from recent code file views.

Fields
Field Name Description
title - String! Descriptive title to display in the UI for the determination.
description - String! More detailed description to display in the UI for the determination.
Example
{
  "title": "xyz789",
  "description": "xyz789"
}

RecordedCommand

Description

Recorded command is a Git command and its metadata which was run for particular repo.

Fields
Field Name Description
start - DateTime! When the command started its execution.
duration - Float! Command run time in seconds.
command - String! The command itself (e.g. "git fetch").
dir - String! Directory in which the command has been run.
path - String! Path to command executable (git executable in most cases).
output - String! Output of the command.
isSuccess - Boolean! Indicates whether the command execution was successful.
Example
{
  "start": "2007-12-03T10:15:30Z",
  "duration": 123.45,
  "command": "abc123",
  "dir": "abc123",
  "path": "xyz789",
  "output": "abc123",
  "isSuccess": false
}

RecordedCommandConnection

Description

RecordedCommandConnection is a connection containing a list of RecordedCommand nodes.

Fields
Field Name Description
nodes - [RecordedCommand!]! A list of recorded commands for given repository.
totalCount - Int! The total number of recorded commands for given repository in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [RecordedCommand],
  "totalCount": 123,
  "pageInfo": PageInfo
}

Redirect

Description

A reference to another Sourcegraph instance.

Fields
Field Name Description
url - String! The URL of the other Sourcegraph instance.
Example
{"url": "xyz789"}

RemoveInsightViewFromDashboardInput

Description

Input object for adding insight view to dashboard.

Fields
Input Field Description
insightViewId - ID! ID of the insight view to remove from the dashboard
dashboardId - ID! ID of the dashboard.
Example
{"insightViewId": "4", "dashboardId": 4}

RepoChangesetsStats

Description

Stats on all the changesets that have been applied to this repository by batch changes.

Fields
Field Name Description
unpublished - Int! The count of unpublished changesets.
draft - Int! The count of draft changesets.
open - Int! The count of open changesets.
merged - Int! The count of merged changesets.
closed - Int! The count of closed changesets.
total - Int! The count of all changesets.
Example
{
  "unpublished": 987,
  "draft": 987,
  "open": 123,
  "merged": 123,
  "closed": 123,
  "total": 123
}

RepoCorruptionLog

Description

A corruption log entry that that records the time of when corruption was detected and a reason why the repo is regarded as corrupt

Fields
Field Name Description
timestamp - DateTime! The time at which the repository was detected to be corrupt
reason - String! The reason why this repository was regarded as corrupt
Example
{
  "timestamp": "2007-12-03T10:15:30Z",
  "reason": "xyz789"
}

RepoEmbeddingJob

Description

A repo embedding job.

Fields
Field Name Description
id - ID! Unique node ID.
state - RepoEmbeddingJobState! State of a repo embedding job.
failureMessage - String Failure message for failed job.
queuedAt - DateTime! Time when repo embedding job was queued.
startedAt - DateTime Time when repo embedding job processing was started.
finishedAt - DateTime Time when repo embedding job processing finished.
processAfter - DateTime Time after which repo embedding job processing should be started.
numResets - Int! Number of repo embedding job processing resets.
numFailures - Int! Number of repo embedding job processing failures.
lastHeartbeatAt - DateTime Time of last heartbeat of a repo embedding job processing.
workerHostname - String! Hostname of a worker on which repo embedding job is processing.
cancel - Boolean! Flag showing that given repo embedding job should be canceled instead of being processed.
repo - Repository The embedded repository.
revision - GitCommit The revision at which the repo was embedded.
stats - RepoEmbeddingsStats! Statistics about the embeddings index job. This will be updated periodically while the embeddings job is processing.
Example
{
  "id": "4",
  "state": "QUEUED",
  "failureMessage": "xyz789",
  "queuedAt": "2007-12-03T10:15:30Z",
  "startedAt": "2007-12-03T10:15:30Z",
  "finishedAt": "2007-12-03T10:15:30Z",
  "processAfter": "2007-12-03T10:15:30Z",
  "numResets": 123,
  "numFailures": 123,
  "lastHeartbeatAt": "2007-12-03T10:15:30Z",
  "workerHostname": "xyz789",
  "cancel": false,
  "repo": Repository,
  "revision": GitCommit,
  "stats": RepoEmbeddingsStats
}

RepoEmbeddingJobState

Description

State types of repo embedding sync jobs.

Values
Enum Value Description

QUEUED

PROCESSING

FAILED

ERRORED

COMPLETED

CANCELED

Example
"QUEUED"

RepoEmbeddingJobsConnection

Description

Repo embedding jobs.

Fields
Field Name Description
nodes - [RepoEmbeddingJob!]! Repo embedding jobs.
totalCount - Int! The total number of jobs in the connection.
pageInfo - ConnectionPageInfo! Pagination information.
Example
{
  "nodes": [RepoEmbeddingJob],
  "totalCount": 123,
  "pageInfo": ConnectionPageInfo
}

RepoEmbeddingsStats

Description

Statistics about an embeddings index job. This will be updated periodically while the embeddings job is processing.

Fields
Field Name Description
filesScheduled - Int! The number of files scheduled to be embedded.
filesEmbedded - Int! The number of files we generated embeddings for. This will be updated periodically while the embeddings job is processing.
filesSkipped - Int! The number of files skipped. This will be updated periodically while the embeddings job is processing.
Example
{"filesScheduled": 987, "filesEmbedded": 123, "filesSkipped": 987}

RepoMetadata

Description

Repo key-value pair metadata

Fields
Field Name Description
keys - RepoMetadataKeyOrValueConnection! Returns paginated list of repo metadata distinct keys matching a query
Arguments
query - String
first - Int

Pagination paramters

last - Int
after - String
before - String
key - RepoMetadataKeyResult Repo metadata key
Arguments
key - String!
Example
{
  "keys": RepoMetadataKeyOrValueConnection,
  "key": RepoMetadataKeyResult
}

RepoMetadataKeyOrValueConnection

Description

Repo metadata key or value connection result`

Fields
Field Name Description
totalCount - Int! Total count of repo key-value pair metadata
nodes - [String!]! A list of repo key-value pair metadata
pageInfo - BidirectionalPageInfo! Pagination information.
Example
{
  "totalCount": 987,
  "nodes": ["xyz789"],
  "pageInfo": BidirectionalPageInfo
}

RepoMetadataKeyResult

Description

Repo metadata key result

Fields
Field Name Description
values - RepoMetadataKeyOrValueConnection! Returns paginated list of repo metadata distinct values matching a query
Arguments
query - String
first - Int

Pagination paramters

last - Int
after - String
before - String
Example
{"values": RepoMetadataKeyOrValueConnection}

Repository

Description

A repository is a Git source control repository that is mirrored from some origin code host.

Fields
Field Name Description
id - ID! The repository's unique ID.
name - String!

The repository's name, as a path with one or more components. It conventionally consists of the repository's hostname and path (joined by "/"), minus any suffixes (such as ".git"). Examples:

  • github.com/foo/bar
  • my-code-host.example.com/myrepo
  • myrepo
uri - String! DEPRECATED: Use name. Use name.
sourceType - RepositoryType! The source of this repository from where it was imported / converted.
description - String! The repository's description.
language - String! The primary programming language in the repository.
createdAt - DateTime! DEPRECATED: This field is unused in known clients. The date when this repository was created on Sourcegraph.
updatedAt - DateTime DEPRECATED: This field is unused in known clients. The date when this repository's metadata was last updated on Sourcegraph.
commit - GitCommit Returns information about the given commit in the repository, or null if no commit exists with the given rev.
Arguments
rev - String!

The Git revision specifier (revspec) for the commit.

inputRevspec - String

Optional input revspec used to construct non-canonical URLs and other "friendly" field values. Used by clients that must ensure consistency of revision resolution within a session/request (so they use full SHAs) but also preserve the user input rev (for user friendliness).

changelist - PerforceChangelist EXPERIMENTAL: Returns infomration about the given changelist of the perforce depot, or null if no changelist exists with the given cid or it is not a perforce depot.
Arguments
cid - String!
firstEverCommit - GitCommit The first commit inside the repo
mirrorInfo - MirrorRepositoryInfo! Information and status related to mirroring, if this repository is a mirror of another repository (e.g., on some code host). In this case, the remote source repository is external to Sourcegraph and the mirror is maintained by the Sourcegraph site (not the other way around).
externalRepository - ExternalRepository! Information about this repository from the external service that it originates from (such as GitHub, GitLab, Phabricator, etc.).
isFork - Boolean! Whether the repository is a fork.
isArchived - Boolean! Whether the repository has been archived.
isPrivate - Boolean! Whether the repository is private.
externalServices - ExternalServiceConnection! Lists all external services which yield this repository.
Arguments
first - Int

Returns the first n external services from the list.

cloneInProgress - Boolean! Whether the repository is currently being cloned. use Repository.mirrorInfo.cloneInProgress instead
textSearchIndex - RepositoryTextSearchIndex Information about the text search index for this repository, or null if text search indexing is not enabled or supported for this repository.
url - String! The URL to this repository.
externalURLs - [ExternalLink!]! The URLs to this repository on external services associated with it.
defaultBranch - GitRef The repository's default Git branch (HEAD symbolic ref). If the repository is currently being cloned or is empty, this field will be null.
gitRefs - GitRefConnection! The repository's Git refs.
Arguments
first - Int

Returns the first n Git refs from the list.

query - String

Return Git refs whose names match the query.

type - GitRefType

Return only Git refs of the given type. Known issue: It is only supported to retrieve Git branch and tag refs, not other Git refs.

orderBy - GitRefOrder

Ordering for Git refs in the list.

interactive - Boolean

Ordering is an expensive operation that doesn't scale for lots of references. If this is true we fallback on not ordering. This should never be false in interactive API requests.

branches - GitRefConnection! The repository's Git branches.
Arguments
first - Int

Returns the first n Git branches from the list.

query - String

Return Git branches whose names match the query.

orderBy - GitRefOrder

Ordering for Git branches in the list.

interactive - Boolean

Ordering is an expensive operation that doesn't scale for lots of references. If this is true we fallback on not ordering. This should never be false in interactive API requests.

tags - GitRefConnection! The repository's Git tags.
Arguments
first - Int

Returns the first n Git tags from the list.

query - String

Return Git tags whose names match the query.

comparison - RepositoryComparison! A Git comparison in this repository between a base and head commit.
Arguments
base - String

The base of the diff ("old" or "left-hand side"), or "HEAD" if not specified.

head - String

The head of the diff ("new" or "right-hand side"), or "HEAD" if not specified.

fetchMissing - Boolean

Attempt to fetch missing revisions from remote if they are not found

contributors - RepositoryContributorConnection! The repository's contributors.
Arguments
revisionRange - String

The Git revision range to compute contributors in.

afterDate - String

The date after which to count contributions.

path - String

Return contributors to files in this path.

first - Int

Returns the first n contributors from the list.

last - Int
after - String
before - String
viewerCanAdminister - Boolean! Whether the viewer has admin privileges on this repository.
label - Markdown! A markdown string that is rendered prominently.
detail - Markdown! A markdown string of that is rendered less prominently.
matches - [SearchResultMatch!]! The result previews of the result.
codeIntelligenceCommitGraph - CodeIntelligenceCommitGraph! Information and status related to the commit graph of this repository calculated for use by code intelligence features.
stars - Int! The star count the repository has in the code host.
keyValuePairs - [KeyValuePair!]! A set of user-defined key-value pairs associated with the repo. Use repo.metadata instead. This field is a deprecated and will be removed in a future release.
metadata - [KeyValuePair!]! A set of user-defined key-value pairs metadata associated with the repo.
topics - [String!]! A list of GitHub or GitLab topics associated with the repo.
diskSizeBytes - BigInt The size of repo when cloned on disk
embeddingExists - Boolean! Returns true if embeddings for the repo are generated.
isRecordingEnabled - Boolean! Returns true if command executed on the repo are recorded.
recordedCommands - RecordedCommandConnection! Returns a list of all recorded commands for given repository.
Arguments
limit - Int

Maximum number of recorded commands returned. If a query specifies a limit higher than 40, it will be capped at 40. The default value is 40. This prevents returning an excessive number of recorded commands for performance reasons.

offset - Int

Skips initial "offset" number of recorded commands. (Default: 0)

changesetsStats - RepoChangesetsStats! Stats on all the changesets that have been created in this repository by batch changes.
batchChanges - BatchChangeConnection! A list of batch changes that have applied a changeset to this repository.
Arguments
first - Int

Returns the first n batch changes from the list.

after - String

Opaque pagination cursor.

state - BatchChangeState

Only return batch changes in this state. If states is also specified, it will take precedence over state.

states - [BatchChangeState!]

Only return batch changes in any of these states. If state is also specified, states will take precedence over it.

viewerCanAdminister - Boolean

Only include batch changes that the viewer can administer.

batchChangesDiffStat - DiffStat! A diff stat for all the changesets that have been applied to this repository by batch changes.
indexConfiguration - IndexConfiguration Gets the indexing configuration associated with the repository.
codeIntelSummary - CodeIntelRepositorySummary! Provides a summary of the most recent upload and index status.
previewGitObjectFilter - GitObjectFilterPreview! The set of git objects that match the given git object type and glob pattern. This resolver is used by the UI to preview what names match a code intelligence policy in a given repository.
Arguments
type - GitObjectType!

The type of Git object described by the configuration policy.

pattern - String!

A pattern matching the name of the matching Git object.

first - Int

When specified, indicates that this request should return the first N items.

countObjectsYoungerThanHours - Int

When specified, the total number of matching Git objects younger than this value will be returned along with the total number of matching objects. This does not affect the set of objects returned as items.

embeddingJobs - RepoEmbeddingJobsConnection! Returns all embedding jobs for the repo.
Arguments
first - Int

Number of jobs returned. Up to 100 jobs are returned by default.

last - Int

The number of nodes to return starting from the end (latest). Note: Use either last or first (see above) in the query. Setting both will return an error.

after - String

Opaque pagination cursor to be used when paginating forwards that may be also used in conjunction with "first" to return the first N nodes.

before - String

Opaque pagination cursor to be used when paginating backwards that may be also used in conjunction with "last" to return the last N nodes.

state - String

Filter by the state of the job.

ingestedCodeowners - CodeownersIngestedFile A file containing manually ingested codeowners data, if any. Null if no data has been uploaded.
Example
{
  "id": 4,
  "name": "abc123",
  "uri": "abc123",
  "sourceType": "GIT_REPOSITORY",
  "description": "xyz789",
  "language": "xyz789",
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z",
  "commit": GitCommit,
  "changelist": PerforceChangelist,
  "firstEverCommit": GitCommit,
  "mirrorInfo": MirrorRepositoryInfo,
  "externalRepository": ExternalRepository,
  "isFork": true,
  "isArchived": true,
  "isPrivate": false,
  "externalServices": ExternalServiceConnection,
  "cloneInProgress": false,
  "textSearchIndex": RepositoryTextSearchIndex,
  "url": "xyz789",
  "externalURLs": [ExternalLink],
  "defaultBranch": GitRef,
  "gitRefs": GitRefConnection,
  "branches": GitRefConnection,
  "tags": GitRefConnection,
  "comparison": RepositoryComparison,
  "contributors": RepositoryContributorConnection,
  "viewerCanAdminister": false,
  "label": Markdown,
  "detail": Markdown,
  "matches": [SearchResultMatch],
  "codeIntelligenceCommitGraph": CodeIntelligenceCommitGraph,
  "stars": 123,
  "keyValuePairs": [KeyValuePair],
  "metadata": [KeyValuePair],
  "topics": ["xyz789"],
  "diskSizeBytes": {},
  "embeddingExists": true,
  "isRecordingEnabled": false,
  "recordedCommands": RecordedCommandConnection,
  "changesetsStats": RepoChangesetsStats,
  "batchChanges": BatchChangeConnection,
  "batchChangesDiffStat": DiffStat,
  "indexConfiguration": IndexConfiguration,
  "codeIntelSummary": CodeIntelRepositorySummary,
  "previewGitObjectFilter": GitObjectFilterPreview,
  "embeddingJobs": RepoEmbeddingJobsConnection,
  "ingestedCodeowners": CodeownersIngestedFile
}

RepositoryComparison

Description

The differences between two concrete Git commits in a repository.

Fields
Field Name Description
baseRepository - Repository! The repository that is the base (left-hand side) of this comparison.
headRepository - Repository! The repository that is the head (right-hand side) of this comparison. Cross-repository comparisons are not yet supported, so this is always equal to RepositoryComparison.baseRepository.
range - GitRevisionRange! The range that this comparison represents.
commits - GitCommitConnection! The commits in the comparison range, excluding the base and including the head.
Arguments
first - Int

Return the first n commits from the list.

path - String

Filter to only the commits that modify files that match path. Path can be either a file or a containing directory.

fileDiffs - FileDiffConnection! The file diffs for each changed file.
Arguments
first - Int

Return the first n file diffs from the list.

after - String

Return file diffs after the given cursor.

paths - [String!]

A list of paths or directories used to filter the diffs

Example
{
  "baseRepository": Repository,
  "headRepository": Repository,
  "range": GitRevisionRange,
  "commits": GitCommitConnection,
  "fileDiffs": FileDiffConnection
}

RepositoryComparisonInterface

Description

Either a preview or an actual repository comparison.

Example
RepositoryComparison

RepositoryContributor

Description

A contributor to a repository.

Fields
Field Name Description
person - Person! The personal information for the contributor.
count - Int! The number of contributions made by this contributor.
repository - Repository! The repository in which the contributions occurred.
commits - GitCommitConnection! Commits by the contributor.
Arguments
first - Int

Return the first n commits.

Example
{
  "person": Person,
  "count": 987,
  "repository": Repository,
  "commits": GitCommitConnection
}

RepositoryContributorConnection

Description

A list of contributors to a repository.

Fields
Field Name Description
nodes - [RepositoryContributor!]! A list of contributors to a repository.
totalCount - Int! The total count of contributors in the connection, if available. This total count may be larger than the number of nodes in this object when the result is paginated.
pageInfo - BidirectionalPageInfo! Pagination information.
Example
{
  "nodes": [RepositoryContributor],
  "totalCount": 123,
  "pageInfo": BidirectionalPageInfo
}

RepositoryFilterPreview

Description

A decorated connection of repositories resulting from 'previewRepositoryFilter'.

Fields
Field Name Description
nodes - [CodeIntelRepository!]! A list of repositories composing the current page.
totalCount - Int! The total number of repositories in this result set.
matchesAllRepos - Boolean! If every repository currently on the instance is matched by this filter.
limit - Int The maximum number of repository matches a single policy can make.
totalMatches - Int! The number of repositories matching the given filter. This value exceeds the value of totalCount of the result when totalMatches > limit.
Example
{
  "nodes": [CodeIntelRepository],
  "totalCount": 987,
  "matchesAllRepos": false,
  "limit": 987,
  "totalMatches": 123
}

RepositoryOrderBy

Description

RepositoryOrderBy enumerates the ways a repositories list can be ordered.

Values
Enum Value Description

REPOSITORY_NAME

REPO_CREATED_AT

REPOSITORY_CREATED_AT

deprecated (use the equivalent REPOSITORY_CREATED_AT)

SIZE

Example
"REPOSITORY_NAME"

RepositoryPreviewPayload

Description

Information about the number of repositories matched from a query

Fields
Field Name Description
query - String! The query used to find number of repository matches.
numberOfRepositories - Int The number of repositories matched.
Example
{
  "query": "xyz789",
  "numberOfRepositories": 123
}

RepositoryRedirect

Description

A repository or a link to another Sourcegraph instance location where this repository may be located.

Types
Union Types

Repository

Redirect

Example
Repository

RepositoryScopeInput

Description

A custom repository scope for an insight data series.

Fields
Input Field Description
repositories - [String!]! The list of repositories included in this scope.
repositoryCriteria - String A search query to select repositories for this scope.
Example
{
  "repositories": ["abc123"],
  "repositoryCriteria": "abc123"
}

RepositorySearchScope

Description

Describes a scope of repositories, this type is used for both the search based scopes and all repositories

Fields
Field Name Description
search - String! The user provided search used to generate the list of repositories the insight runs over.
allRepositories - Boolean! Indicates if this search scope represents all repositories
Example
{
  "search": "xyz789",
  "allRepositories": false
}

RepositoryStats

Description

FOR INTERNAL USE ONLY: A repository statistic

Fields
Field Name Description
gitDirBytes - BigInt! The amount of bytes stored in .git directories
indexedLinesCount - BigInt! The number of lines indexed
total - Int! The number of all repositories in the instance, without soft-deleted or blocked repositories.
cloned - Int! The number of cloned repositories in the instance. This number might be higher than 'total', if soft-deleted repositories haven't been cleaned up yet.
cloning - Int! The number of repositories in the instance that are currently being cloned.
notCloned - Int! The number of repositories in the instance that not cloned yet.
failedFetch - Int! The number of repositories where initial cloning or subsequent fetching resulted in an error.
indexed - Int! The number of indexed repositories
corrupted - Int! The number of repositories that are currently corrupt
embedded - Int! The number of repositories that have embeddings
Example
{
  "gitDirBytes": {},
  "indexedLinesCount": {},
  "total": 123,
  "cloned": 123,
  "cloning": 123,
  "notCloned": 987,
  "failedFetch": 123,
  "indexed": 123,
  "corrupted": 123,
  "embedded": 123
}

RepositoryTextSearchIndex

Description

Information about a repository's text search index.

Fields
Field Name Description
repository - Repository! The indexed repository.
status - RepositoryTextSearchIndexStatus The status of the text search index, if available.
refs - [RepositoryTextSearchIndexedRef!]! Git refs in the repository that are configured for text search indexing.
host - repositoryIndexserverHost Information about the indexserver that hosts the repo's index.
Example
{
  "repository": Repository,
  "status": RepositoryTextSearchIndexStatus,
  "refs": [RepositoryTextSearchIndexedRef],
  "host": repositoryIndexserverHost
}

RepositoryTextSearchIndexStatus

Description

The status of a repository's text search index.

Fields
Field Name Description
updatedAt - DateTime! The date that the index was last updated.
contentByteSize - BigInt! The byte size of the original content.
contentFilesCount - Int! The number of files in the original content.
indexByteSize - Int! The byte size of the index.
indexShardsCount - Int! The number of index shards.
newLinesCount - Int! EXPERIMENTAL: The number of newlines appearing in the index.
defaultBranchNewLinesCount - Int! EXPERIMENTAL: The number of newlines in the default branch.
otherBranchesNewLinesCount - Int! EXPERIMENTAL: The number of newlines in the other branches.
Example
{
  "updatedAt": "2007-12-03T10:15:30Z",
  "contentByteSize": {},
  "contentFilesCount": 123,
  "indexByteSize": 987,
  "indexShardsCount": 987,
  "newLinesCount": 987,
  "defaultBranchNewLinesCount": 987,
  "otherBranchesNewLinesCount": 123
}

RepositoryTextSearchIndexedRef

Description

A Git ref (usually a branch) in a repository that is configured to be indexed for text search.

Fields
Field Name Description
ref - GitRef! The Git ref (usually a branch) that is configured to be indexed for text search. To find the specific commit SHA that was indexed, use RepositoryTextSearchIndexedRef.indexedCommit; this field's ref target resolves to the current target, not the target at the time of indexing.
indexed - Boolean! Whether a text search index exists for this ref.
current - Boolean! Whether the text search index is of the current commit for the Git ref. If false, the index is stale.
indexedCommit - GitObject The indexed Git commit (which may differ from the ref's current target if the index is out of date). If indexed is false, this field's value is null.
skippedIndexed - SkippedIndexed EXPERIMENTAL: Information about the files that were not indexed.
Example
{
  "ref": GitRef,
  "indexed": false,
  "current": false,
  "indexedCommit": GitObject,
  "skippedIndexed": SkippedIndexed
}

RepositoryType

Description

All possible types of currently supported repositories, even though they may be stored as a git repository on disk.

Values
Enum Value Description

GIT_REPOSITORY

PERFORCE_DEPOT

Example
"GIT_REPOSITORY"

ResolvedBatchSpecWorkspace

Description

A not persisted resolved workspace, returned from resolveWorkspacesForBatchSpec.

Fields
Field Name Description
repository - Repository! The repository to run over.
branch - GitRef! The branch to run over.
path - String! The path to run in.
onlyFetchWorkspace - Boolean! If true, only the files within the workspace will be fetched.
ignored - Boolean! If true, this workspace has been skipped, because some rule forced this. For now, the only one is a .batchignore file existing in the repository.
unsupported - Boolean! If true, this workspace has been skipped, because the code host on which the repository is hosted is not supported.
searchResultPaths - [String!]! If this workspace was resolved based on a search, this is the list of paths to files that have been included in the search results.
Example
{
  "repository": Repository,
  "branch": GitRef,
  "path": "xyz789",
  "onlyFetchWorkspace": true,
  "ignored": false,
  "unsupported": false,
  "searchResultPaths": ["abc123"]
}

Role

Description

A role

Fields
Field Name Description
id - ID! The globally unique identifier for this role.
name - String! The human readable name for this role.
system - Boolean! Indicates whether a role is a default system role, which cannot be modified or deleted, or a custom role added by a site admin.
permissions - PermissionConnection! The list of permissions that will be granted to any user with this role.
Arguments
first - Int

The limit argument for forward pagination.

last - Int

The limit argument for backward pagination.

after - String

The cursor argument for forward pagination.

before - String

The cursor argument for backward pagination.

createdAt - DateTime! The date and time when the role was created.
Example
{
  "id": "4",
  "name": "xyz789",
  "system": false,
  "permissions": PermissionConnection,
  "createdAt": "2007-12-03T10:15:30Z"
}

RoleConnection

Description

A list of roles.

Fields
Field Name Description
nodes - [Role!]! A list of roles.
totalCount - Int! The total count of roles in the connection.
pageInfo - ConnectionPageInfo! Pagination information.
Example
{
  "nodes": [Role],
  "totalCount": 987,
  "pageInfo": ConnectionPageInfo
}

RootWithKey

Description

Pairs a root directory with comparison key used to match index configurations for the same repository "project".

Fields
Field Name Description
root - String! The root.
comparisonKey - String!

A hash of the root and indexer values.

This value can be used to quickly compare whether or not explicit configuration and inferred configuration refer to the same "project" in a given repository. See AutoIndexJobDescription.comparisonKey.

Example
{
  "root": "abc123",
  "comparisonKey": "abc123"
}

SaveInsightAsNewViewInput

Description

Input for saving a new view on an insight.

Fields
Input Field Description
insightViewId - ID! The insight view ID we are creating a new view from.
options - LineChartOptionsInput! The options for this line chart.
dashboard - ID The dashboard ID to associate this insight with once created.
viewControls - InsightViewControlsInput The default values for filters and aggregates for this line chart.
Example
{
  "insightViewId": "4",
  "options": LineChartOptionsInput,
  "dashboard": "4",
  "viewControls": InsightViewControlsInput
}

SavedSearch

Description

A saved search query, defined in settings.

Fields
Field Name Description
id - ID! The unique ID of this saved query.
description - String! The description.
query - String! The query.
notify - Boolean! Whether or not to notify the owner of the saved search via email. This owner is either a single user, or every member of an organization that owns the saved search.
notifySlack - Boolean! Whether or not to notify on Slack.
namespace - Namespace! The user or org that owns this saved search.
slackWebhookURL - String The Slack webhook URL associated with this saved search, if any.
Example
{
  "id": 4,
  "description": "xyz789",
  "query": "xyz789",
  "notify": false,
  "notifySlack": true,
  "namespace": Namespace,
  "slackWebhookURL": "xyz789"
}

SavedSearchesConnection

Description

A paginated connection for saved search queries, defined in settings.

Fields
Field Name Description
nodes - [SavedSearch!]! A list of saved searches.
totalCount - Int! The total number of saved searches in the connection.
pageInfo - ConnectionPageInfo! Pagination information.
Example
{
  "nodes": [SavedSearch],
  "totalCount": 987,
  "pageInfo": ConnectionPageInfo
}

SchemaDriftSummary

Description

A summary of a schema drift.

Fields
Field Name Description
name - String! Name of the table that contains the drift
problem - String! The problem that was found
solution - String! The suggested solution to the problem
diff - String The diff of the schema drift
statements - [String!] The SQL to fix the schema drift
urlHint - String The Sourcegraph URL that contains the potential fix
Example
{
  "name": "xyz789",
  "problem": "xyz789",
  "solution": "abc123",
  "diff": "xyz789",
  "statements": ["abc123"],
  "urlHint": "xyz789"
}

ScopedInsightQueryPayload

Description

Information about scope query validity

Fields
Field Name Description
query - String! The original query.
isValid - Boolean! Whether the query is valid.
invalidReason - String The reason why the query is invalid.
Example
{
  "query": "xyz789",
  "isValid": false,
  "invalidReason": "abc123"
}

SearchAggregationMode

Description

Supported aggregation modes for search aggregations

Values
Enum Value Description

REPO

PATH

AUTHOR

CAPTURE_GROUP

REPO_METADATA

Example
"REPO"

SearchAggregationNotAvailable

Description

Indicates that a search aggregation is not available

Fields
Field Name Description
reason - String! The specific reason a search aggregation is not available
reasonType - NotAvailableReasonType! The general reason a search aggregation is not available
mode - SearchAggregationMode! The SearchAggregationMode that is unavailable
Example
{
  "reason": "xyz789",
  "reasonType": "INVALID_QUERY",
  "mode": "REPO"
}

SearchAggregationResult

Description

Defines how the data series is generated.

Example
ExhaustiveSearchAggregationResult

SearchAlert

Description

A search-related alert message.

Fields
Field Name Description
title - String! The title.
description - String The description.
kind - String An identifier indicating the kind of alert
proposedQueries - [SearchQueryDescription!] "Did you mean: ____" query proposals
Example
{
  "title": "xyz789",
  "description": "abc123",
  "kind": "abc123",
  "proposedQueries": [SearchQueryDescription]
}

SearchContext

Description

A search context. Specifies a set of repositories to be searched.

Fields
Field Name Description
id - ID! The unique id of the search context.
name - String! The name of the search context.
namespace - Namespace The owner (user or org) of the search context. If nil, search context is considered instance-level.
description - String! The description of the search context.
spec - String! Fully-qualified search context spec for use when querying. Examples: global, @username, @username/ctx, and @org/ctx.
autoDefined - Boolean! Whether the search context is autodefined by Sourcegraph. The only autodefined context currently is the global search context ("global").
query - String! Sourcegraph search query that defines the search context. e.g. "r:^github.com/org (rev:bar or rev:HEAD) file:^sub/dir"
repositories - [SearchContextRepositoryRevisions!]! Repositories and their revisions that will be searched when querying.
public - Boolean! Public property controls the visibility of the search context. Public search context is available to any user on the instance. If a public search context contains private repositories, those are filtered out for unauthorized users. Private search contexts are only available to their owners. Private user search context is available only to the user, private org search context is available only to the members of the org, and private instance-level search contexts are available only to site-admins.
updatedAt - DateTime! Date and time the search context was last updated.
viewerCanManage - Boolean! If current viewer can manage (edit, delete) the search context.
viewerHasAsDefault - Boolean! If the viewer has set this context as default.
viewerHasStarred - Boolean! If the viewer has starred this context.
Example
{
  "id": "4",
  "name": "xyz789",
  "namespace": Namespace,
  "description": "abc123",
  "spec": "xyz789",
  "autoDefined": false,
  "query": "xyz789",
  "repositories": [SearchContextRepositoryRevisions],
  "public": false,
  "updatedAt": "2007-12-03T10:15:30Z",
  "viewerCanManage": true,
  "viewerHasAsDefault": true,
  "viewerHasStarred": false
}

SearchContextConnection

Description

A list of search contexts

Fields
Field Name Description
nodes - [SearchContext!]! A list of search contexts.
totalCount - Int! The total number of search contexts in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [SearchContext],
  "totalCount": 987,
  "pageInfo": PageInfo
}

SearchContextEditInput

Description

Input for editing an existing search context.

Fields
Input Field Description
name - String! Search context name. Not the same as the search context spec. Search context namespace and search context name are used to construct the fully-qualified search context spec. Example mappings from search context spec to search context name: global -> global, @user -> user, @org -> org, @user/ctx1 -> ctx1, @org/ctxs/ctx -> ctxs/ctx.
description - String! Search context description.
public - Boolean! Public property controls the visibility of the search context. Public search context is available to any user on the instance. If a public search context contains private repositories, those are filtered out for unauthorized users. Private search contexts are only available to their owners. Private user search context is available only to the user, private org search context is available only to the members of the org, and private instance-level search contexts are available only to site-admins.
query - String! Sourcegraph search query that defines the search context. e.g. "r:^github.com/org (rev:bar or rev:HEAD) file:^sub/dir"
Example
{
  "name": "xyz789",
  "description": "abc123",
  "public": true,
  "query": "xyz789"
}

SearchContextInput

Description

Input for a new search context.

Fields
Input Field Description
name - String! Search context name. Not the same as the search context spec. Search context namespace and search context name are used to construct the fully-qualified search context spec. Example mappings from search context spec to search context name: global -> global, @user -> user, @org -> org, @user/ctx1 -> ctx1, @org/ctxs/ctx -> ctxs/ctx.
description - String! Search context description.
public - Boolean! Public property controls the visibility of the search context. Public search context is available to any user on the instance. If a public search context contains private repositories, those are filtered out for unauthorized users. Private search contexts are only available to their owners. Private user search context is available only to the user, private org search context is available only to the members of the org, and private instance-level search contexts are available only to site-admins.
namespace - ID Namespace of the search context (user or org). If not set, search context is considered instance-level.
query - String! Sourcegraph search query that defines the search context. e.g. "r:^github.com/org (rev:bar or rev:HEAD) file:^sub/dir"
Example
{
  "name": "xyz789",
  "description": "abc123",
  "public": true,
  "namespace": "4",
  "query": "abc123"
}

SearchContextRepositoryRevisions

Description

Specifies a set of revisions to be searched within a repository.

Fields
Field Name Description
repository - Repository! The repository to be searched.
revisions - [String!]! The set of revisions to be searched.
Example
{
  "repository": Repository,
  "revisions": ["abc123"]
}

SearchContextRepositoryRevisionsInput

Description

Input for a set of revisions to be searched within a repository.

Fields
Input Field Description
repositoryID - ID! ID of the repository to be searched.
revisions - [String!]! Revisions in the repository to be searched.
Example
{
  "repositoryID": "4",
  "revisions": ["xyz789"]
}

SearchContextsOrderBy

Description

SearchContextsOrderBy enumerates the ways a search contexts list can be ordered.

Values
Enum Value Description

SEARCH_CONTEXT_SPEC

SEARCH_CONTEXT_UPDATED_AT

Example
"SEARCH_CONTEXT_SPEC"

SearchFilter

Description

A search filter.

Fields
Field Name Description
value - String! The value.
label - String! The string to be displayed in the UI.
count - Int! Number of matches for a given filter.
limitHit - Boolean! Whether the results returned are incomplete.
kind - String! The kind of filter. Should be "file" or "repo".
Example
{
  "value": "xyz789",
  "label": "abc123",
  "count": 987,
  "limitHit": false,
  "kind": "xyz789"
}

SearchInsightDataSeriesDefinition

Description

Defines an insight data series that is constructed from a Sourcegraph search query.

Fields
Field Name Description
seriesId - String! Unique ID for the series.
query - String! The query string.
repositoryScope - InsightRepositoryScope! A scope of repositories defined for this series. Series with repository scopes defined by a search query are not identifiable via this field use repositoryDefinition instead
repositoryDefinition - InsightRepositoryDefinition! A definition of Repositories this series will operate over.
timeScope - InsightTimeScope! The scope of time for which the insight data is generated.
generatedFromCaptureGroups - Boolean! Whether or not the the time series are derived from the captured groups of the search results.
isCalculated - Boolean! Whether or not the series has been pre-calculated, or still needs to be resolved. This field is largely only used for the code insights webapp, and should be considered unstable (planned to be deprecated in a future release).
groupBy - GroupByField The field to group results by. (For compute powered insights only.) This field is experimental and should be considered unstable in the API.
Example
{
  "seriesId": "xyz789",
  "query": "xyz789",
  "repositoryScope": InsightRepositoryScope,
  "repositoryDefinition": RepositorySearchScope,
  "timeScope": InsightIntervalTimeScope,
  "generatedFromCaptureGroups": true,
  "isCalculated": false,
  "groupBy": "REPO"
}

SearchInsightLivePreviewInput

Description

Required input to generate a time series for a search insight using live preview.

Fields
Input Field Description
query - String! The query string.
label - String! The desired label for the series. Will be overwritten when series are dynamically generated.
repositoryScope - RepositoryScopeInput! The scope of repositories.
timeScope - TimeScopeInput! The scope of time.
generatedFromCaptureGroups - Boolean! Whether or not to generate the timeseries results from the query capture groups.
groupBy - GroupByField Use this field to specify a compute insight. Note: this is experimental and should be considered unstable
Example
{
  "query": "abc123",
  "label": "abc123",
  "repositoryScope": RepositoryScopeInput,
  "timeScope": TimeScopeInput,
  "generatedFromCaptureGroups": true,
  "groupBy": "REPO"
}

SearchInsightLivePreviewSeries

Description

Input object for a live preview search based code insight.

Fields
Field Name Description
points - [InsightDataPoint!]! The data points for the time series.
label - String! The label for the data series.
Example
{
  "points": [InsightDataPoint],
  "label": "xyz789"
}

SearchInsightPreviewInput

Description

Required input to generate a live preview for an insight.

Fields
Input Field Description
repositoryScope - RepositoryScopeInput! The scope of repositories.
timeScope - TimeScopeInput! The scope of time.
series - [SearchSeriesPreviewInput!]! The series to generate previews for
Example
{
  "repositoryScope": RepositoryScopeInput,
  "timeScope": TimeScopeInput,
  "series": [SearchSeriesPreviewInput]
}

SearchJob

Description

A search job.

Fields
Field Name Description
id - ID! The ID of the search job.
query - String! The query to run.
state - SearchJobState! The state of the search job.
creator - User The user who created the search job.
createdAt - DateTime! The date and time the search job was created.
startedAt - DateTime The date and time the search job was started.
finishedAt - DateTime The date and time the search job was finished.
URL - String The url to download the search job results.
logURL - String The url to download search job logs.
repoStats - SearchJobStats! The repository stats for the search job.
Example
{
  "id": "4",
  "query": "abc123",
  "state": "QUEUED",
  "creator": User,
  "createdAt": "2007-12-03T10:15:30Z",
  "startedAt": "2007-12-03T10:15:30Z",
  "finishedAt": "2007-12-03T10:15:30Z",
  "URL": "abc123",
  "logURL": "abc123",
  "repoStats": SearchJobStats
}

SearchJobConnection

Description

A connection that returns search jobs.

Fields
Field Name Description
nodes - [SearchJob!]! The list of searches.
totalCount - Int! The total count of searches.
pageInfo - BidirectionalPageInfo! Information to aid in pagination.
Example
{
  "nodes": [SearchJob],
  "totalCount": 123,
  "pageInfo": BidirectionalPageInfo
}

SearchJobState

Description

The state of a search job.

Values
Enum Value Description

QUEUED

The search job has been created and is waiting to be processed.

PROCESSING

The search job is being processed.

ERRORED

The search job had an error.

FAILED

The search job has failed.

COMPLETED

The search job has completed.

CANCELED

The search job was canceled.
Example
"QUEUED"

SearchJobStats

Description

The repository stats for a search job.

Fields
Field Name Description
total - Int! The total number of items.
completed - Int! The number of items that have completed.
failed - Int! The number of items that have failed.
inProgress - Int! The number of items that are in progress.
Example
{"total": 123, "completed": 987, "failed": 123, "inProgress": 987}

SearchJobsOrderBy

Description

The order by which search jobs are sorted.

Values
Enum Value Description

QUERY

Sort search jobs by their query.

CREATED_AT

Sort search jobs by their creation date.

STATE

Sort search jobs by their state.
Example
"QUERY"

SearchPatternType

Description

The search pattern type.

Values
Enum Value Description

standard

literal

regexp

structural

lucky

keyword

codycontext

Example
"standard"

SearchQueryAggregate

Description

Information about search aggregations

Fields
Field Name Description
modeAvailability - [AggregationModeAvailability!]! A list of the possible aggregation modes and if they are available
aggregations - SearchAggregationResult! A result of aggregating a search query for the specified aggregation mode. mode - the requested aggregation mode, if null a default will be selected based on the search query limit - is the maximum number of aggregation groups to return, this limit will not override any internal limits. extendedTimeout - indicates of the aggregation request should use an extended timeout.
Arguments
limit - Int
extendedTimeout - Boolean
Example
{
  "modeAvailability": [AggregationModeAvailability],
  "aggregations": ExhaustiveSearchAggregationResult
}

SearchQueryAnnotation

Description

Additional information describing attributes of a query.

Fields
Field Name Description
name - String! A name for this query annotation label.
value - String! An opaque value for this query annotation.
Example
{
  "name": "abc123",
  "value": "abc123"
}

SearchQueryDescription

Description

A search query description.

Fields
Field Name Description
description - String The description.
query - String! The query.
annotations - [SearchQueryAnnotation!] Additional optional information describing attributes of this query.
Example
{
  "description": "abc123",
  "query": "abc123",
  "annotations": [SearchQueryAnnotation]
}

SearchQueryOutputFormat

Description

The output format to emit for a parsed query.

Values
Enum Value Description

JSON

JSON format.

SEXP

S-expression format.

MERMAID

Mermaid flowchart format.
Example
"JSON"

SearchQueryOutputPhase

Description

Represents phases in query parsing. The parse tree corresponds closely to the input query syntax. A subsequent processing phase on the parse tree generates a job tree. The job tree is an internal representation analogous to a database query plan. The job tree discards information about query syntax and corresponds closely to backend services (text search, git commit search, etc.).

Values
Enum Value Description

PARSE_TREE

JOB_TREE

Example
"PARSE_TREE"

SearchQueryOutputVerbosity

Description

The output format to emit for a parsed query.

Values
Enum Value Description

MINIMAL

Minimal verbosity outputs only nodes.

BASIC

Basic verbosity outputs nodes and essential fields associated with nodes.

MAXIMAL

Maximal verbosity outputs nodes and all information associated with nodes.
Example
"MINIMAL"

SearchResult

Description

A search result.

Example
FileMatch

SearchResultMatch

Description

A match in a search result. Matches make up the body content of a search result.

Fields
Field Name Description
url - String! URL for the individual result match.
body - Markdown! A markdown string containing the preview contents of the result match.
highlights - [Highlight!]! A list of highlights that specify locations of matches of the query in the body. Each highlight is a line number, character offset, and length. Currently, highlights are only displayed on match bodies that are code blocks. If the result body is a code block, exclude the markdown code fence lines in the line and character count. Leave as an empty list if no highlights are available.
Example
{
  "url": "xyz789",
  "body": Markdown,
  "highlights": [Highlight]
}

SearchResults

Description

Search results.

Fields
Field Name Description
results - [SearchResult!]! The results. Inside each SearchResult there may be multiple matches, e.g. a FileMatch may contain multiple line matches.
matchCount - Int! The total number of matches returned by this search. This is different than the length of the results array in that e.g. a single results array entry may contain multiple matches. For example, the results array may contain two file matches and this field would report 6 ("3 line matches per file") while the length of the results array would report 3 ("3 FileMatch results"). Typically, 'approximateResultCount', not this field, is shown to users.
resultCount - Int! DEPRECATED: Renamed to 'matchCount' for less ambiguity. renamed to matchCount for less ambiguity
approximateResultCount - String! The approximate number of results. This is like the length of the results array, except it can indicate the number of results regardless of whether or not the limit was hit. Currently, this is represented as e.g. "5+" results. This string is typically shown to users to indicate the true result count.
limitHit - Boolean! Whether or not the results limit was hit. In paginated requests, this field is always false. Use 'pageInfo.hasNextPage' instead.
sparkline - [Int!]! Integers representing the sparkline for the search results.
repositories - [Repository!]! Repositories from results.
repositoriesCount - Int! The number of repositories that had results (for clients that just wish to know how many without querying the, sometimes extremely large, list).
cloning - [Repository!]! Repositories that are busy cloning onto gitserver. In paginated search requests, some repositories may be cloning. These are reported here and you may choose to retry the paginated request with the same cursor after they have cloned OR you may simply continue making further paginated requests and choose to skip the cloning repositories.
missing - [Repository!]! Repositories or commits that do not exist. In paginated search requests, some repositories may be missing (e.g. if Sourcegraph is aware of them but is temporarily unable to serve them). These are reported here and you may choose to retry the paginated request with the same cursor and they may no longer be missing OR you may simply continue making further paginated requests and choose to skip the missing repositories.
timedout - [Repository!]! Repositories or commits which we did not manage to search in time. Trying again usually will work. In paginated search requests, this field is not relevant.
indexUnavailable - Boolean! DEPRECATED: This field is not used in known clients, and will always return false. True if indexed search is enabled but was not available during this search.
alert - SearchAlert An alert message that should be displayed before any results.
elapsedMilliseconds - Int! The time it took to generate these results.
dynamicFilters - [SearchFilter!]! Dynamic filters generated by the search results
Example
{
  "results": [FileMatch],
  "matchCount": 123,
  "resultCount": 987,
  "approximateResultCount": "abc123",
  "limitHit": false,
  "sparkline": [123],
  "repositories": [Repository],
  "repositoriesCount": 987,
  "cloning": [Repository],
  "missing": [Repository],
  "timedout": [Repository],
  "indexUnavailable": false,
  "alert": SearchAlert,
  "elapsedMilliseconds": 123,
  "dynamicFilters": [SearchFilter]
}

SearchResultsStats

Description

Statistics about search results.

Fields
Field Name Description
approximateResultCount - String! The approximate number of results returned.
sparkline - [Int!]! The sparkline.
languages - [LanguageStatistics!]! Statistics about the languages represented in the search results. Known issue: The LanguageStatistics.totalBytes field values are incorrect in the result.
Example
{
  "approximateResultCount": "xyz789",
  "sparkline": [123],
  "languages": [LanguageStatistics]
}

SearchSeriesPreviewInput

Description

Required input to generate a live preview for a series.

Fields
Input Field Description
query - String! The query string.
label - String! The desired label for the series. Will be overwritten when series are dynamically generated.
generatedFromCaptureGroups - Boolean! Whether or not to generate the timeseries results from the query capture groups.
groupBy - GroupByField Use this field to specify a compute insight. Note: this is experimental and should be considered unstable
Example
{
  "query": "xyz789",
  "label": "xyz789",
  "generatedFromCaptureGroups": false,
  "groupBy": "REPO"
}

SearchVersion

Description

The version of the search syntax.

Values
Enum Value Description

V1

Search syntax that defaults to regexp search.

V2

Search syntax that defaults to literal-only search.

V3

Search syntax that defaults to standard search.
Example
"V1"

SeriesDisplayOptions

Description

Options that affect which series to display for an insight.

Fields
Field Name Description
sortOptions - SeriesSortOptions! Sort options for the series.
limit - Int Max number of series to return.
numSamples - Int Max number of samples to return for all the series on the view.
Example
{
  "sortOptions": SeriesSortOptions,
  "limit": 987,
  "numSamples": 987
}

SeriesDisplayOptionsInput

Description

Input type for series display options.

Fields
Input Field Description
sortOptions - SeriesSortOptionsInput Sort options for the series.
limit - Int Max number of series to return.
numSamples - Int Max number of samples to return.
Example
{
  "sortOptions": SeriesSortOptionsInput,
  "limit": 123,
  "numSamples": 987
}

SeriesSortDirection

Description

Sort direction for series.

Values
Enum Value Description

ASC

DESC

Example
"ASC"

SeriesSortMode

Description

Sort mode for series.

Values
Enum Value Description

RESULT_COUNT

LEXICOGRAPHICAL

DATE_ADDED

Example
"RESULT_COUNT"

SeriesSortOptions

Description

Series sort options.

Fields
Field Name Description
mode - SeriesSortMode Sort mode for series.
direction - SeriesSortDirection Sort direction for series.
Example
{"mode": "RESULT_COUNT", "direction": "ASC"}

SeriesSortOptionsInput

Description

Input type for series sort options.

Fields
Input Field Description
mode - SeriesSortMode! Sort mode for series.
direction - SeriesSortDirection! Sort direction for series.
Example
{"mode": "RESULT_COUNT", "direction": "ASC"}

Session

Description

An active user session.

Fields
Field Name Description
canSignOut - Boolean! Whether the user can sign out of this session on Sourcegraph.
Example
{"canSignOut": false}

Settings

Description

Settings is a version of a configuration settings file.

Fields
Field Name Description
id - Int! The ID.
subject - SettingsSubject! The subject that these settings are for.
author - User The author, or null if there is no author or the authoring user was deleted.
createdAt - DateTime! The time when this was created.
contents - JSONCString! The stringified JSON contents of the settings. The contents may include "//"-style comments and trailing commas in the JSON.
configuration - Configuration! DEPRECATED: This field will be removed in a future release. The configuration. use the contents field instead
Example
{
  "id": 987,
  "subject": SettingsSubject,
  "author": User,
  "createdAt": "2007-12-03T10:15:30Z",
  "contents": JSONCString,
  "configuration": Configuration
}

SettingsCascade

Description

The configurations for all of the relevant settings subjects, plus the merged settings.

Fields
Field Name Description
subjects - [SettingsSubject!]! The other settings subjects that are applied with lower precedence than this subject to form the final merged settings. For example, a user in 2 organizations would have the following settings subjects: site (global settings), org 1, org 2, and the user.
final - String! The effective final merged settings as (stringified) JSON, merged from all of the subjects.
merged - Configuration! DEPRECATED: This field will be removed in a future release. The effective final merged settings, merged from all of the subjects. use final instead
Example
{
  "subjects": [SettingsSubject],
  "final": "abc123",
  "merged": Configuration
}

SettingsEdit

Description

An edit to a JSON property in a settings JSON object. The JSON property to edit can be nested.

Fields
Input Field Description
keyPath - [KeyPathSegment!]!

The key path of the property to update.

Inserting into an existing array is not yet supported.

value - JSONValue

The new JSON-encoded value to insert. If the field's value is not set, the property is removed. (This is different from the field's value being the JSON null value.)

When the value is a non-primitive type, it must be specified using a GraphQL variable, not an inline literal, or else the GraphQL parser will return an error.

valueIsJSONCEncodedString - Boolean Whether to treat the value as a JSONC-encoded string, which makes it possible to perform an edit that preserves (or adds/removes) comments. Default = false
Example
{
  "keyPath": [KeyPathSegment],
  "value": JSONValue,
  "valueIsJSONCEncodedString": false
}

SettingsMutation

Description

Mutations that update settings (global, organization, or user settings). These mutations are grouped together because they:

  • are all versioned to avoid race conditions with concurrent editors
  • all apply to a specific settings subject (i.e., a user, an organization, or the whole site)

Grouping them lets us extract those common parameters to the Mutation.settingsMutation field.

Fields
Field Name Description
editSettings - UpdateSettingsPayload Edit a single property in the settings object.
Arguments
edit - SettingsEdit!

The edit to apply to the settings.

editConfiguration - UpdateSettingsPayload DEPRECATED Use editSettings instead. This field is a deprecated alias for it and will be removed in a future release.
Arguments
overwriteSettings - UpdateSettingsPayload Overwrite the existing settings with the new settings.
Arguments
contents - String!

A JSON object (stringified) of the settings. Trailing commas and "//"-style comments are supported. The entire previous settings value will be overwritten by this new value.

Example
{
  "editSettings": UpdateSettingsPayload,
  "editConfiguration": UpdateSettingsPayload,
  "overwriteSettings": UpdateSettingsPayload
}

SettingsMutationGroupInput

Description

Input for Mutation.settingsMutation, which contains fields that all settings (global, organization, and user settings) mutations need.

Fields
Input Field Description
subject - ID! The subject whose settings to mutate (organization, user, etc.).
lastID - Int The ID of the last-known settings known to the client, or null if there is none. This field is used to prevent race conditions when there are concurrent editors.
Example
{"subject": 4, "lastID": 987}

SettingsSubject

Description

SettingsSubject is something that can have settings: a site ("global settings", which is different from "site configuration"), an organization, or a user.

Fields
Field Name Description
id - ID! The ID.
latestSettings - Settings The latest settings.
settingsURL - String The URL to the settings.
viewerCanAdminister - Boolean! Whether the viewer can modify the subject's settings.
settingsCascade - SettingsCascade! All settings for this subject, and the individual levels in the settings cascade (global > organization > user) that were merged to produce the final merged settings.
configurationCascade - ConfigurationCascade! DEPRECATED Use settingsCascade instead. This field is a deprecated alias for it and will be removed in a future release.
Possible Types
SettingsSubject Types

User

Org

DefaultSettings

Site

Example
{
  "id": "4",
  "latestSettings": Settings,
  "settingsURL": "xyz789",
  "viewerCanAdminister": false,
  "settingsCascade": SettingsCascade,
  "configurationCascade": ConfigurationCascade
}

Signature

Description

A signature.

Fields
Field Name Description
person - Person! The person.
date - String! The date.
Example
{
  "person": Person,
  "date": "xyz789"
}

Site

Description

A site is an installation of Sourcegraph that consists of one or more servers that share the same configuration and database. The site is a singleton; the API only ever returns the single global site.

Fields
Field Name Description
id - ID! The site's opaque GraphQL ID. This is NOT the "site ID" as it is referred to elsewhere; use the siteID field for that. (GraphQL node types conventionally have an id field of type ID! that globally identifies the node.)
siteID - String! The site ID.
configuration - SiteConfiguration!

The site's configuration. Only visible to site admins.

If returnSafeConfigsOnly is true, returns a subset of the configuration classified as safe config.

Arguments
returnSafeConfigsOnly - Boolean
latestSettings - Settings The site's latest site-wide settings (which are the second-lowest-precedence in the configuration cascade for a user).
settingsCascade - SettingsCascade! The global settings for this site, and the final merged settings. All viewers can access this field.
configurationCascade - ConfigurationCascade! DEPRECATED Use settingsCascade instead. This field is a deprecated alias for it and will be removed in a future release.
settingsURL - String The URL to the site's settings.
canReloadSite - Boolean! Whether the viewer can reload the site (with the reloadSite mutation).
viewerCanAdminister - Boolean! Whether the viewer can modify the subject's settings.
accessTokens - AccessTokenConnection! A list of all access tokens on this site.
Arguments
first - Int

Returns the first n access tokens from the list.

authProviders - AuthProviderConnection! A list of all authentication providers. This information is visible to all viewers and does not contain any secret information.
externalAccounts - ExternalAccountConnection! A list of all user external accounts on this site.
Arguments
first - Int

Returns the first n external accounts from the list.

user - ID

Include only external accounts associated with this user.

serviceType - String

Include only external accounts with this service type.

serviceID - String

Include only external accounts with this service ID.

clientID - String

Include only external accounts with this client ID.

buildVersion - String! The build version of the Sourcegraph software that is running on this site (of the form NNNNN_YYYY-MM-DD_XXXXX, like 12345_2018-01-01_abcdef).
productVersion - String! The product version of the Sourcegraph software that is running on this site.
updateCheck - UpdateCheck! Information about software updates for the version of Sourcegraph that this site is running.
needsRepositoryConfiguration - Boolean! Whether the site needs to be configured to add repositories.
externalServicesFromFile - Boolean! Whether the external services haven been created from a configuration file specified in the EXTSVC_CONFIG_FILE.
allowEditExternalServicesWithFile - Boolean! Whether the external services can be updated even if externalServicesFromFile is true. All changes made while externalServicesFromFile is true will be discarded once Sourcegraph restarts.
freeUsersExceeded - Boolean! Whether the site is over the limit for free user accounts, and a warning needs to be shown to all users. Only applies if the site does not have a valid license.
alerts - [Alert!]! Alerts to display to the viewer.
hasCodeIntelligence - Boolean! BACKCOMPAT: Always returns true.
sendsEmailVerificationEmails - Boolean! Whether the server sends emails to users to verify email addresses. If false, then site admins must manually verify users' email addresses.
productSubscription - ProductSubscriptionStatus! Information about this site's product subscription status.
usageStatistics - SiteUsageStatistics! Usage statistics for this site.
Arguments
days - Int

Days of history (based on current UTC time).

weeks - Int

Weeks of history (based on current UTC time).

months - Int

Months of history (based on current UTC time).

analytics - Analytics! New usage statistics/analytics for this site.
users - SiteUsers! List all users.
Arguments
query - String

Return users whose usernames or display names match the query.

siteAdmin - Boolean

Returns users who have been active in a given period of time.

username - String

Returns users that contain filter in the username field.

email - String

Returns users that contain filter in the email field.

lastActiveAt - SiteUsersDateRangeInput

Returns users for the given lastActive enum period. When omitted does NOT apply and returns for all period available.

deletedAt - SiteUsersDateRangeInput

Returns either deleted or not deleted users. Returns all users when omitted.

createdAt - SiteUsersDateRangeInput

Returns users who where created within a given date time range.

eventsCount - SiteUsersNumberRangeInput

Returns users whose events count within a given range.

monitoringStatistics - MonitoringStatistics! Monitoring overview for this site. Note: This is primarily used for displaying recently-fired alerts in the web app. If your intent is to monitor Sourcegraph, it is better to configure alerting or query Prometheus directly in order to ensure that if the frontend goes down you still receive alerts: Configure alerting: https://docs.sourcegraph.com/admin/observability/alerting Query Prometheus directly: https://docs.sourcegraph.com/admin/observability/alerting_custom_consumption
allowSiteSettingsEdits - Boolean! Whether changes can be made to site settings through the API. When global settings are configured through the GLOBAL_SETTINGS_FILE environment variable, site settings edits cannot be made through the API.
upgradeReadiness - UpgradeReadiness! FOR INTERNAL USE ONLY: Returns information about instance upgrade readiness.
autoUpgradeEnabled - Boolean! FOR INTERNAL USE ONLY: The state of readiness to auto upgrade the Sourcegraph instance via migrator commands.
perUserCompletionsQuota - Int The quota of completions requests allowed per user in a day. Null, if unlimited.
perUserCodeCompletionsQuota - Int The quota of code completions requests allowed per user in a day. Null, if unlimited.
requiresVerifiedEmailForCody - Boolean! Whether users are required to have a verified email in order to access Cody.
isCodyEnabled - Boolean! Whether Cody is enabled for this site.
codyLLMConfiguration - CodyLLMConfiguration If Cody is enabled, this returns how Cody is configured to talk to the LLM.
codyConfigFeatures - CodyConfigFeatures

Decides which features to enable for the users of this SG instance

Site-admin only.

codyGatewayRateLimitStatus - [CodyGatewayRateLimitStatus!]

Returns the status of the Cody Rate limits when using the sourcegraph provider. If the instance is not using the Cody Gateway there will be no rate limits.

Site-admin only.

Example
{
  "id": "4",
  "siteID": "abc123",
  "configuration": SiteConfiguration,
  "latestSettings": Settings,
  "settingsCascade": SettingsCascade,
  "configurationCascade": ConfigurationCascade,
  "settingsURL": "xyz789",
  "canReloadSite": false,
  "viewerCanAdminister": true,
  "accessTokens": AccessTokenConnection,
  "authProviders": AuthProviderConnection,
  "externalAccounts": ExternalAccountConnection,
  "buildVersion": "abc123",
  "productVersion": "xyz789",
  "updateCheck": UpdateCheck,
  "needsRepositoryConfiguration": true,
  "externalServicesFromFile": true,
  "allowEditExternalServicesWithFile": true,
  "freeUsersExceeded": false,
  "alerts": [Alert],
  "hasCodeIntelligence": false,
  "sendsEmailVerificationEmails": false,
  "productSubscription": ProductSubscriptionStatus,
  "usageStatistics": SiteUsageStatistics,
  "analytics": Analytics,
  "users": SiteUsers,
  "monitoringStatistics": MonitoringStatistics,
  "allowSiteSettingsEdits": true,
  "upgradeReadiness": UpgradeReadiness,
  "autoUpgradeEnabled": false,
  "perUserCompletionsQuota": 123,
  "perUserCodeCompletionsQuota": 987,
  "requiresVerifiedEmailForCody": true,
  "isCodyEnabled": true,
  "codyLLMConfiguration": CodyLLMConfiguration,
  "codyConfigFeatures": CodyConfigFeatures,
  "codyGatewayRateLimitStatus": [
    CodyGatewayRateLimitStatus
  ]
}

SiteConfiguration

Description

The configuration for a site.

Fields
Field Name Description
id - Int! The unique identifier of this site configuration version.
effectiveContents - JSONCString! The effective configuration JSON.
validationMessages - [String!]! Messages describing validation problems or usage of deprecated configuration in the configuration JSON. This includes both JSON Schema validation problems and other messages that perform more advanced checks on the configuration (that can't be expressed in the JSON Schema).
history - SiteConfigurationChangeConnection EXPERIMENTAL: A list of diffs to depict what changed since the previous version of this configuration. Only site admins may perform this query.
Arguments
first - Int

The number of nodes to return starting from the beginning (oldest). Note: Use either first or last (see below) in the query. Setting both will return an error.

last - Int

The number of nodes to return starting from the end (latest). Note: Use either last or first (see above) in the query. Setting both will return an error.

after - String

Opaque pagination cursor to be used when paginating forwards that may be also used in conjunction with "first" to return the first N nodes.

before - String

Opaque pagination cursor to be used when paginating backwards that may be also used in conjunction with "last" to return the last N nodes.

licenseInfo - LicenseInfo! License information from license key. Available only to site-admins.
Example
{
  "id": 987,
  "effectiveContents": JSONCString,
  "validationMessages": ["abc123"],
  "history": SiteConfigurationChangeConnection,
  "licenseInfo": LicenseInfo
}

SiteConfigurationChange

Description

A diff representing the change in the site config compared to the previous version.

Fields
Field Name Description
id - ID! The ID of the site config in the history.
author - User The user who made this change. If empty, it indicates that either the author's information is not available or the change in the site config was applied via an internal process (example: site startup or SITE_CONFIG_FILE being reloaded).
diff - String! The diff string when diffed against the previous site config.
createdAt - DateTime! The timestamp when this change in the site config was applied.
updatedAt - DateTime! The timestamp when this change in the site config was modified. Usually this should be the same as createdAt as entries in the site config history are considered immutable.
Example
{
  "id": "4",
  "author": User,
  "diff": "abc123",
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z"
}

SiteConfigurationChangeConnection

Description

A list of site config diffs. Diff generation may not be available from the very start depending on when the value of redacted_contents is available in the database.

Fields
Field Name Description
nodes - [SiteConfigurationChange!]! A list of diffs in the site config
totalCount - Int! The total number of diffs in the connection.
pageInfo - ConnectionPageInfo! Pagination information.
Example
{
  "nodes": [SiteConfigurationChange],
  "totalCount": 123,
  "pageInfo": ConnectionPageInfo
}

SiteUsagePeriod

Description

SiteUsagePeriod describes a site's usage statistics for a given timespan. This information is visible to all viewers.

Fields
Field Name Description
startTime - String! The time when this started.
userCount - Int! The user count.
registeredUserCount - Int! The registered user count.
anonymousUserCount - Int! The anonymous user count.
integrationUserCount - Int! The count of registered users that have been active on a code host integration. Excludes anonymous users.
Example
{
  "startTime": "abc123",
  "userCount": 123,
  "registeredUserCount": 987,
  "anonymousUserCount": 123,
  "integrationUserCount": 123
}

SiteUsageStatistics

Description

SiteUsageStatistics describes a site's aggregate usage statistics. This information is visible to all viewers.

Fields
Field Name Description
daus - [SiteUsagePeriod!]! Recent daily active users.
waus - [SiteUsagePeriod!]! Recent weekly active users.
maus - [SiteUsagePeriod!]! Recent monthly active users.
Example
{
  "daus": [SiteUsagePeriod],
  "waus": [SiteUsagePeriod],
  "maus": [SiteUsagePeriod]
}

SiteUser

Description

Site user.

Fields
Field Name Description
id - ID! The unique ID for the user.
username - String! User's username.
email - String User's primary email.
displayName - String User's display name
createdAt - String! The datetime when user was created in the system.
lastActiveAt - String The datetime when user was last active.
deletedAt - String The datetime when user was deleted.
siteAdmin - Boolean! Whether user is site admin or not.
scimControlled - Boolean! Whether the user is controlled through SCIM.
eventsCount - Float! Total number of user's event_logs.
locked - Boolean! Whether or not the user account is locked.
Example
{
  "id": "4",
  "username": "xyz789",
  "email": "abc123",
  "displayName": "abc123",
  "createdAt": "xyz789",
  "lastActiveAt": "abc123",
  "deletedAt": "abc123",
  "siteAdmin": true,
  "scimControlled": true,
  "eventsCount": 123.45,
  "locked": true
}

SiteUserOrderBy

Description

SiteUserOrderBy enumerates the ways a users list can be ordered.

Values
Enum Value Description

USERNAME

EMAIL

User's primary email.

EVENTS_COUNT

The total number of user's event_logs.

LAST_ACTIVE_AT

The last event_log datetime.

CREATED_AT

The datetime when user was added to the system.

DELETED_AT

The datetime when user was soft deleted.

SITE_ADMIN

Whether the user is site admin or not.
Example
"USERNAME"

SiteUsers

Description

Site users.

Fields
Field Name Description
totalCount - Float! User total count.
nodes - [SiteUser!]! List of users.
Arguments
limit - Int

Returns the "limit" number users from the list.

offset - Int

Skips initial "offset" number of users.

orderBy - SiteUserOrderBy

Returns users ordered by a given column.

descending - Boolean

Returns ordered users in descending order provided by orderBy field.

Example
{"totalCount": 123.45, "nodes": [SiteUser]}

SiteUsersDateRangeInput

Description

SiteUsersDateRangeInput argument to filter based on date range or date equals to null

Fields
Input Field Description
lte - DateTime Less than or equal to
gte - DateTime Greater than or equal to
not - Boolean Negation
empty - Boolean Equal to Null
Example
{
  "lte": "2007-12-03T10:15:30Z",
  "gte": "2007-12-03T10:15:30Z",
  "not": false,
  "empty": false
}

SiteUsersNumberRangeInput

Description

SiteUsersNumberRangeInput argument to filter based on the number range

Fields
Input Field Description
gte - Float Less than or equal to
lte - Float Greater than or equal to
Example
{"gte": 987.65, "lte": 987.65}

SkippedIndexed

Description

EXPERIMENTAL: Information about the files that were not indexed.

Fields
Field Name Description
count - BigInt! The count of files that were not indexed.
query - String! The query to retrieve the list of files that were not indexed.
Example
{"count": {}, "query": "abc123"}

SlowRequest

Description

A logged slow GraphQL request, captured by the backend.

Fields
Field Name Description
index - String! The index of this request.
start - DateTime! The date at which this request was started.
duration - Float! The duration of the request.
user - User The user associated with that request, if any.
name - String! The name of the GraphQL request.
source - String! The source from which the request originated.
repository - Repository The repository referenced by the request, if any.
variables - String! The variables used to build the GraphQL request.
errors - [String!]! The errors returned if the request failed.
query - String! The GraphQL query.
filepath - String The file path referenced by the request, if any.
Example
{
  "index": "xyz789",
  "start": "2007-12-03T10:15:30Z",
  "duration": 123.45,
  "user": User,
  "name": "abc123",
  "source": "abc123",
  "repository": Repository,
  "variables": "xyz789",
  "errors": ["xyz789"],
  "query": "abc123",
  "filepath": "xyz789"
}

SlowRequestConnection

Description

The result for Query.slowRequests.

Fields
Field Name Description
nodes - [SlowRequest!]! A list of slow graphql requests logs.
totalCount - Int! The total number of slow graphql logs in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [SlowRequest],
  "totalCount": 987,
  "pageInfo": PageInfo
}

SnippetAttribution

Description

EXPERIMENTAL: Attribution result from snippetAttribution.

Fields
Field Name Description
repositoryName - String!

The name of the repository containing the snippet.

Note: we do not return a type Repository since repositoryName may represent a repository not on this instance. eg a match from the sourcegraph.com open source corpus.

Example
{"repositoryName": "abc123"}

SnippetAttributionConnection

Description

EXPERIMENTAL: A list of snippet attributions.

Fields
Field Name Description
totalCount - Int!

totalCount is the total number of repository attributions we found before stopping the search.

Note: if we didn't finish searching the full corpus then limitHit will be true. For filtering use case this means if limitHit is true you need to be conservative with TotalCount and assume it could be higher.

limitHit - Boolean! limitHit is true if we stopped searching before looking into the full corpus. If limitHit is true then it is possible there are more than totalCount attributions.
snippetThreshold - AttributionSnippetThreshold! snippetThreshold presents to the client whether or not search was run because of the snippet size, as attribution is only considered for snippets of sizes above a certain threshold.
pageInfo - PageInfo! The pagination info for the connection.
nodes - [SnippetAttribution!]! The page set of SnippetAttribution entries in this connection.
Example
{
  "totalCount": 987,
  "limitHit": false,
  "snippetThreshold": AttributionSnippetThreshold,
  "pageInfo": PageInfo,
  "nodes": [SnippetAttribution]
}

SpeakerType

Description

Speaker type, human or assistant

Values
Enum Value Description

HUMAN

ASSISTANT

Example
"HUMAN"

StatusMessage

Example
GitUpdatesDisabled

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example
"abc123"

Submodule

Description

A Git submodule

Fields
Field Name Description
url - String! The remote repository URL of the submodule.
commit - String! The commit of the submodule.
path - String! The path to which the submodule is checked out.
Example
{
  "url": "abc123",
  "commit": "abc123",
  "path": "abc123"
}

SurveyResponse

Description

An individual response to a user satisfaction (NPS) survey.

Fields
Field Name Description
id - ID! The unique ID of the survey response
user - User The user who submitted the survey (if they were authenticated at the time).
email - String The email that the user manually entered (if they were NOT authenticated at the time).
score - Int! User's likelihood of recommending Sourcegraph to a friend, from 0-10.
reason - String The answer to "What is the most important reason for the score you gave".
better - String The answer to "What can Sourcegraph do to provide a better product"
otherUseCase - String The answer to "What do you use Sourcegraph for?".
createdAt - DateTime! The time when this response was created.
Example
{
  "id": 4,
  "user": User,
  "email": "abc123",
  "score": 987,
  "reason": "xyz789",
  "better": "xyz789",
  "otherUseCase": "abc123",
  "createdAt": "2007-12-03T10:15:30Z"
}

SurveyResponseConnection

Description

A list of survey responses

Fields
Field Name Description
nodes - [SurveyResponse!]! A list of survey responses.
totalCount - Int! The total count of survey responses in the connection. This total count may be larger than the number of nodes in this object when the result is paginated.
last30DaysCount - Int! The count of survey responses submitted since 30 calendar days ago at 00:00 UTC.
averageScore - Float! The average score of survey responses in the connection submitted since 30 calendar days ago at 00:00 UTC.
netPromoterScore - Int! The net promoter score (NPS) of survey responses in the connection submitted since 30 calendar days ago at 00:00 UTC. Return value is a signed integer, scaled from -100 (all detractors) to +100 (all promoters). See https://en.wikipedia.org/wiki/Net_Promoter for explanation.
Example
{
  "nodes": [SurveyResponse],
  "totalCount": 123,
  "last30DaysCount": 123,
  "averageScore": 987.65,
  "netPromoterScore": 987
}

SurveySubmissionInput

Description

Input for a user satisfaction (NPS) survey submission.

Fields
Input Field Description
email - String User-provided email address, if there is no currently authenticated user. If there is, this value will not be used.
score - Int! User's likelihood of recommending Sourcegraph to a friend, from 0-10.
otherUseCase - String The answer to "What do you use Sourcegraph for?".
better - String The answer to "What would make Sourcegraph better?"
Example
{
  "email": "abc123",
  "score": 123,
  "otherUseCase": "abc123",
  "better": "abc123"
}

Symbol

Description

A code symbol (e.g., a function, variable, type, class, etc.). It is derived from DocumentSymbol as defined in the Language Server Protocol (see https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/#textDocument_documentSymbol).

Fields
Field Name Description
name - String! The name of the symbol.
containerName - String The name of the symbol that contains this symbol, if any. This field's value is not guaranteed to be structured in such a way that callers can infer a hierarchy of symbols.
kind - SymbolKind! The kind of the symbol.
language - String! The programming language of the symbol.
location - Location! The location where this symbol is defined.
url - String! The URL to this symbol (using the input revision specifier, which may not be immutable).
canonicalURL - String! The canonical URL to this symbol (using an immutable revision specifier).
fileLocal - Boolean! Whether or not the symbol is local to the file it's defined in.
Example
{
  "name": "abc123",
  "containerName": "xyz789",
  "kind": "UNKNOWN",
  "language": "xyz789",
  "location": Location,
  "url": "xyz789",
  "canonicalURL": "xyz789",
  "fileLocal": false
}

SymbolBlock

Description

FileBlock specifies a symbol to display within the block.

Fields
Field Name Description
id - String! ID of the block.
symbolInput - SymbolBlockInput! Symbol block input.
Example
{
  "id": "abc123",
  "symbolInput": SymbolBlockInput
}

SymbolBlockInput

Description

SymbolBlockInput contains the information necessary to find the symbol.

Fields
Field Name Description
repositoryName - String! Name of the repository, e.g. "github.com/sourcegraph/sourcegraph".
filePath - String! Path within the repository, e.g. "client/web/file.tsx".
revision - String An optional revision, e.g. "pr/feature-1", "a9505a2947d3df53558e8c88ff8bcef390fc4e3e". If omitted, we use the latest revision (HEAD).
lineContext - Int! Number of lines to show before and after the matched symbol line.
symbolName - String! The symbol name.
symbolContainerName - String! Name of the symbol container.
symbolKind - SymbolKind! The symbol kind.
Example
{
  "repositoryName": "xyz789",
  "filePath": "abc123",
  "revision": "xyz789",
  "lineContext": 123,
  "symbolName": "xyz789",
  "symbolContainerName": "abc123",
  "symbolKind": "UNKNOWN"
}

SymbolConnection

Description

A list of symbols.

Fields
Field Name Description
nodes - [Symbol!]! A list of symbols.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [Symbol],
  "pageInfo": PageInfo
}

SymbolKind

Description

All possible kinds of symbols. This set matches that of the Language Server Protocol (https://microsoft.github.io/language-server-protocol/specification#workspace_symbol).

Values
Enum Value Description

UNKNOWN

FILE

MODULE

NAMESPACE

PACKAGE

CLASS

METHOD

PROPERTY

FIELD

CONSTRUCTOR

ENUM

INTERFACE

FUNCTION

VARIABLE

CONSTANT

STRING

NUMBER

BOOLEAN

ARRAY

OBJECT

KEY

NULL

ENUMMEMBER

STRUCT

EVENT

OPERATOR

TYPEPARAMETER

Example
"UNKNOWN"

SyncError

Description

FOR INTERNAL USE ONLY: A status message produced when repositories could not be synced

Fields
Field Name Description
message - String! The message of this status message
Example
{"message": "xyz789"}

Team

Description

A team is a grouping of users/persons into a common handle. Teams are commonly used to define codeowners.

Fields
Field Name Description
id - ID! The unique ID of the team.
name - String! The name of the team. Needs to be globally unique across usernames, organization names, and team names. Team names can use alphanumeric characters, - dash and / forward slash.
url - String! URL to link to the teams profile page.
avatarURL - String URL to an avatar of this team.
displayName - String A human readable name substitute for the name. Null, if not defined.
readonly - Boolean! A team can be made read-only from the CLI instructing the UI to show a warning banner that this is managed externally, and management features will only be available to site-admins. It can also still be manipulated from the CLI.
members - TeamMemberConnection! The teams direct members. That is members that are strictly part of this team, but not members of child teams. Team membership is NOT inherited.
Arguments
first - Int

Returns the first n team members from the list.

after - String

Opaque pagination cursor.

search - String

Optionally apply a text search filter over the results.

parentTeam - Team Parent team can be null, if this is a root team.
childTeams - TeamConnection! The list of direct child teams.
Arguments
first - Int

Returns the first n teams from the list.

after - String

Opaque pagination cursor.

search - String

Optionally apply a text search filter over the results.

viewerCanAdminister - Boolean! True, if the current user can modify this team.
creator - User The creator of this team. Null, if the user was deleted.
external - Boolean! True, if the team is external, i.e. not found in our database. Example: CODEOWNERS files can contain references to GitHub teams which are not the part of Sourcegraph teams.
Example
{
  "id": 4,
  "name": "xyz789",
  "url": "abc123",
  "avatarURL": "xyz789",
  "displayName": "abc123",
  "readonly": true,
  "members": TeamMemberConnection,
  "parentTeam": Team,
  "childTeams": TeamConnection,
  "viewerCanAdminister": true,
  "creator": User,
  "external": false
}

TeamConnection

Description

A list of teams.

Fields
Field Name Description
totalCount - Int! The total count of items in the connection.
pageInfo - PageInfo! The pagination info for the connection.
nodes - [Team!]! The current page of teams in this connection.
Example
{
  "totalCount": 123,
  "pageInfo": PageInfo,
  "nodes": [Team]
}

TeamMember

Description

A team member is an entity that can be associated to a team.

For now, this will be User, and will be expanded to User | Person later.

Fields
Field Name Description
teams - TeamConnection! All the teams this TeamMember is a direct member of.
Arguments
first - Int

Returns the first n teams from the list.

after - String

Opaque pagination cursor.

search - String

Optionally apply a text search filter over the results.

Possible Types
TeamMember Types

User

Example
{"teams": TeamConnection}

TeamMemberConnection

Description

A list of team members.

Fields
Field Name Description
totalCount - Int! The total count of items in the connection.
pageInfo - PageInfo! The pagination info for the connection.
nodes - [TeamMember!]! The current page of team members in this connection.
Example
{
  "totalCount": 987,
  "pageInfo": PageInfo,
  "nodes": [TeamMember]
}

TeamMemberInput

Description

Options to specify a user for team membership. Multiple options can be provided, with the following precedence order: (Other mismatches will be discarded)

  • UserID
  • Username
  • Email
  • External Account fields

Examples:

  • If ID is set and no match, return.
  • If ID and username is set, and ID matches but username doesn't, match.
Fields
Input Field Description
userID - ID Explicitly define a user by ID.
username - String Explicitly define a user by username in Sourcegraph.
email - String If the email is associated to a user and verified, the user account will be matched.
externalAccountServiceID - String If the user has an associated external account, use this. externalAccountServiceID and externalAccountServiceType must be set and either of externalAccountAccountID externalAccountLogin are required as well. Service ID for the GitHub OAuth provider, for example, is https://github.com/.
externalAccountServiceType - String If the user has an associated external account, use this. externalAccountServiceID and externalAccountServiceType must be set and either of externalAccountAccountID externalAccountLogin are required as well. Service Type for the GitHub OAuth provider, for example, is github.
externalAccountAccountID - String If the user has an associated external account, use this. externalAccountServiceID and externalAccountServiceType must be set and either of externalAccountAccountID externalAccountLogin are required as well. Account ID is the unique identifier on the external account platform.
externalAccountLogin - String If the user has an associated external account, use this. externalAccountServiceID and externalAccountServiceType must be set and either of externalAccountAccountID externalAccountLogin are required as well. Account Login is usually the username on the external account platform.
Example
{
  "userID": "4",
  "username": "abc123",
  "email": "abc123",
  "externalAccountServiceID": "xyz789",
  "externalAccountServiceType": "xyz789",
  "externalAccountAccountID": "xyz789",
  "externalAccountLogin": "xyz789"
}

TelemetryEventBillingMetadataInput

Description

Billing-related metadata for a telemetry event.

Fields
Input Field Description
product - String!

Billing product ID associated with the event.

IDs must come from a static set of values in libraries - it is left as a string in the API to allow some flexibility.

category - String!

Billing category ID the event falls into.

IDs must come from a static set of values in libraries - it is left as a string in the API to allow some flexibility.

Example
{
  "product": "xyz789",
  "category": "abc123"
}

TelemetryEventInput

Description

Properties comprising a telemetry V2 event that can be reported by a client.

Fields
Input Field Description
timestamp - DateTime

Timestamp at which the time was recorded. If not provided, a timestamp is generated when the server receives the event, but this does not guarantee consistent ordering or accuracy.

This parameter is only available in Sourcegraph 5.2.5 and later.

feature - String!

Feature associated with the event in camelCase, e.g. 'myFeature'.

Feature names must come from a static set of values in libraries - it is left as a string in the API to allow some flexibility.

action - String!

Action associated with the event in camelCase, e.g. 'pageView'.

Action names must come from a static set of values in libraries - it is left as a string in the API to allow some flexibility.

source - TelemetryEventSourceInput! Information about where this event came from.
parameters - TelemetryEventParametersInput! Parameters of the event.
marketingTracking - TelemetryEventMarketingTrackingInput

Optional marketing campaign tracking parameters.

🚨 SECURITY: This metadata is NEVER exported from private Sourcegraph instances, and is only exported for events tracked in the public Sourcegraph.com instance.

Example
{
  "timestamp": "2007-12-03T10:15:30Z",
  "feature": "xyz789",
  "action": "abc123",
  "source": TelemetryEventSourceInput,
  "parameters": TelemetryEventParametersInput,
  "marketingTracking": TelemetryEventMarketingTrackingInput
}

TelemetryEventMarketingTrackingInput

Description

Marketing campaign tracking parameters for a telemetry V2 event.

🚨 SECURITY: This metadata is NEVER exported from private Sourcegraph instances, and is only exported for events tracked in the public Sourcegraph.com instance.

Fields
Input Field Description
url - String URL the event occurred on.
firstSourceURL - String Initial URL the user landed on.
cohortID - String Cohort ID to identify the user as part of a specific A/B test.
referrer - String Referrer URL that refers the user to Sourcegraph.
lastSourceURL - String Last source URL visited by the user.
deviceSessionID - String Device session ID to identify the user's session.
sessionReferrer - String Session referrer URL for the user.
sessionFirstURL - String First URL the user visited in their current session.
Example
{
  "url": "xyz789",
  "firstSourceURL": "xyz789",
  "cohortID": "xyz789",
  "referrer": "abc123",
  "lastSourceURL": "xyz789",
  "deviceSessionID": "xyz789",
  "sessionReferrer": "abc123",
  "sessionFirstURL": "abc123"
}

TelemetryEventMetadataInput

Description

A single, PII-free metadata item for telemetry V2 events.

Fields
Input Field Description
key - String! The key identifying this metadata entry.
value - JSONValue!

Numeric value associated with the key. Enforcing numeric values eliminates risks of accidentally shipping sensitive or private data.

The value type in the schema is JSONValue for flexibility, but we ONLY accept numeric values (integers and floats) - any other value will be rejected.

Example
{
  "key": "xyz789",
  "value": JSONValue
}

TelemetryEventParametersInput

Description

Properties of a telemetry V2 event.

Fields
Input Field Description
version - Int! Version of the event parameters, used for indicating the "shape" of this event's metadata.
metadata - [TelemetryEventMetadataInput!] Strictly typed metadata that must not contain any sensitive data or PII.
privateMetadata - JSONValue

Private metadata in JSON format. Unlike metadata, values can be of any type, not just numeric.

🚨 SECURITY: This metadata is NOT exported from instances by default, as it can contain arbitrarily-shaped data that may accidentally contain sensitive or private contents.

billingMetadata - TelemetryEventBillingMetadataInput Billing-related metadata.
interactionID - String

Optional interaction ID that can be provided to indicate the interaction this event belongs to. It overrides the X-Sourcegraph-Interaction-ID header if one is set on the request recording the event.

This parameter is only available in Sourcegraph 5.2.4 and later.

Example
{
  "version": 987,
  "metadata": [TelemetryEventMetadataInput],
  "privateMetadata": JSONValue,
  "billingMetadata": TelemetryEventBillingMetadataInput,
  "interactionID": "abc123"
}

TelemetryEventSourceInput

Description

Properties comprising the source of a telemetry V2 event reported by a client.

Fields
Input Field Description
client - String! Source client of the event.
clientVersion - String Version of the source client of the event.
Example
{
  "client": "xyz789",
  "clientVersion": "xyz789"
}

TelemetryMutation

Description

Mutations for recording events from clients.

Fields
Field Name Description
recordEvents - EmptyResponse

Record a batch of telemetry events.

❗ Do not use this directly when recording events in-product - use the @sourcegraph/telemetry package, or equivalent, instead.

Arguments
Example
{"recordEvents": EmptyResponse}

TelemetryQuery

Description

Queries for exported telemetry events.

Fields
Field Name Description
exportedEvents - ExportedEventsConnection! List events that were recently exported, up to the retention period configured on the instance.
Arguments
first - Int

Returns the first n recently exported events.

after - String

Opaque pagination cursor.

Example
{"exportedEvents": ExportedEventsConnection}

TemporarySettings

Description

Temporary settings for a user.

Fields
Field Name Description
contents - String! A JSON string representing the temporary settings.
Example
{"contents": "abc123"}

TimeIntervalStepInput

Description

A time scope defined using a time interval (ex. 5 days)

Fields
Input Field Description
unit - TimeIntervalStepUnit! The time unit for the interval.
value - Int! The value for the interval.
Example
{"unit": "HOUR", "value": 987}

TimeIntervalStepUnit

Description

Time interval units.

Values
Enum Value Description

HOUR

DAY

WEEK

MONTH

YEAR

Example
"HOUR"

TimeScopeInput

Description

A custom time scope for an insight data series.

Fields
Input Field Description
stepInterval - TimeIntervalStepInput Sets a time scope using a step interval (intervals of time).
Example
{"stepInterval": TimeIntervalStepInput}

TimeoutDatapointAlert

Description

Represents a terminally incomplete data point at a specific time, and optionally for a specific repository.

Fields
Field Name Description
time - DateTime! The data point that is incomplete.
Example
{"time": "2007-12-03T10:15:30Z"}

TreeEntry

Description

A file, directory, or other tree entry.

Fields
Field Name Description
path - String! The full path (relative to the repository root) of this tree entry.
name - String! The base name (i.e., file name only) of this tree entry.
isDirectory - Boolean! Whether this tree entry is a directory.
url - String! The URL to this tree entry (using the input revision specifier, which may not be immutable).
canonicalURL - String! The canonical URL to this tree entry (using an immutable revision specifier).
externalURLs - [ExternalLink!]! The URLs to this tree entry on external services.
symbols - SymbolConnection! Symbols defined in this file or directory.
Arguments
first - Int

Returns the first n symbols from the list.

query - String

Return symbols matching the query.

submodule - Submodule Submodule metadata if this tree points to a submodule
isSingleChild - Boolean! Whether this tree entry is a single child
history - TreeEntryConnection! The revision history for this file or directory.
Arguments
first - Int
after - String
commit - GitCommit! The Git commit containing this tree entry was reached through. Note that a tree entry can exist in multiple commits.
Possible Types
TreeEntry Types

GitTree

GitBlob

Example
{
  "path": "abc123",
  "name": "xyz789",
  "isDirectory": true,
  "url": "xyz789",
  "canonicalURL": "abc123",
  "externalURLs": [ExternalLink],
  "symbols": SymbolConnection,
  "submodule": Submodule,
  "isSingleChild": false,
  "history": TreeEntryConnection,
  "commit": GitCommit
}

TreeEntryConnection

Description

A list of TreeEntry

Fields
Field Name Description
nodes - [TreeEntry!]! A list of TreeEntry.
totalCount - Int The total count of TreeEntry in the connection. This total count may be larger than the number of nodes in this object when the result is paginated.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [TreeEntry],
  "totalCount": 123,
  "pageInfo": PageInfo
}

UpdateCheck

Description

Information about software updates for Sourcegraph.

Fields
Field Name Description
pending - Boolean! Whether an update check is currently in progress.
checkedAt - DateTime When the last update check was completed, or null if no update check has been completed (or performed) yet.
errorMessage - String If an error occurred during the last update check, this message describes the error.
updateVersionAvailable - String If an update is available, the version string of the updated version.
Example
{
  "pending": true,
  "checkedAt": "2007-12-03T10:15:30Z",
  "errorMessage": "xyz789",
  "updateVersionAvailable": "abc123"
}

UpdateCodyGatewayAccessInput

Description

Partial update to apply to a subscription's Cody Gateway access. Omitted fields are not applied.

Fields
Input Field Description
enabled - Boolean Enable or disable Cody Gateway access.
chatCompletionsRateLimit - BigInt

Override default requests per time interval.

Set to 0 to remove the override.

chatCompletionsRateLimitIntervalSeconds - Int

Override default interval for rate limiting.

Set to 0 to remove the override.

chatCompletionsAllowedModels - [String!] Override the set of allowed models for chat completions for this subscription.
codeCompletionsRateLimit - BigInt

Override default requests per time interval.

Set to 0 to remove the override.

codeCompletionsRateLimitIntervalSeconds - Int

Override default interval for rate limiting.

Set to 0 to remove the override.

codeCompletionsAllowedModels - [String!] Override the set of allowed models for chat completions for this subscription.
embeddingsRateLimit - BigInt

Override default requests per time interval for embeddings generation.

Set to 0 to remove the override.

embeddingsRateLimitIntervalSeconds - Int

Override default interval for rate limiting for embeddings generation.

Set to 0 to remove the override.

embeddingsAllowedModels - [String!] Override the set of allowed models for embeddings generation for this subscription.
Example
{
  "enabled": false,
  "chatCompletionsRateLimit": {},
  "chatCompletionsRateLimitIntervalSeconds": 123,
  "chatCompletionsAllowedModels": [
    "xyz789"
  ],
  "codeCompletionsRateLimit": {},
  "codeCompletionsRateLimitIntervalSeconds": 123,
  "codeCompletionsAllowedModels": [
    "abc123"
  ],
  "embeddingsRateLimit": {},
  "embeddingsRateLimitIntervalSeconds": 987,
  "embeddingsAllowedModels": ["abc123"]
}

UpdateExternalServiceInput

Description

Fields to update for an existing external service.

Fields
Input Field Description
id - ID! The id of the external service to update.
displayName - String The updated display name, if provided.
config - String The updated config, if provided.
Example
{
  "id": "4",
  "displayName": "abc123",
  "config": "abc123"
}

UpdateInsightSeriesInput

Description

Input object for update insight series mutation.

Fields
Input Field Description
seriesId - String! Unique ID for the series.
enabled - Boolean The desired activity state (enabled or disabled) for the series.
Example
{"seriesId": "abc123", "enabled": false}

UpdateInsightsDashboardInput

Description

Input object for updating a dashboard.

Fields
Input Field Description
title - String Dashboard title.
grants - InsightsPermissionGrantsInput Permissions to grant to the dashboard.
Example
{
  "title": "xyz789",
  "grants": InsightsPermissionGrantsInput
}

UpdateLineChartSearchInsightInput

Description

Input for updating a line chart search insight.

Fields
Input Field Description
dataSeries - [LineChartSearchInsightDataSeriesInput!]! The complete list of data series on this line chart. Note: excluding a data series will remove it.
repositoryScope - RepositoryScopeInput The scope of repositories for the insight, this scope will apply to all dataSeries unless another scope is provided by a series.
timeScope - TimeScopeInput The time scope for this insight, this scope will apply to all dataSeries unless another scope is provided by a series.
presentationOptions - LineChartOptionsInput! The presentation options for this line chart.
viewControls - InsightViewControlsInput! The default values for filters and aggregates for this line chart.
Example
{
  "dataSeries": [LineChartSearchInsightDataSeriesInput],
  "repositoryScope": RepositoryScopeInput,
  "timeScope": TimeScopeInput,
  "presentationOptions": LineChartOptionsInput,
  "viewControls": InsightViewControlsInput
}

UpdatePieChartSearchInsightInput

Description

Input for updating a pie chart search insight

Fields
Input Field Description
query - String! The query string.
repositoryScope - RepositoryScopeInput! The scope of repositories.
presentationOptions - PieChartOptionsInput! Options for this pie chart.
Example
{
  "query": "abc123",
  "repositoryScope": RepositoryScopeInput,
  "presentationOptions": PieChartOptionsInput
}

UpdateProductSubscriptionInput

Description

Partial update to apply to a subscription. Omitted fields are not applied.

Fields
Input Field Description
codyGatewayAccess - UpdateCodyGatewayAccessInput Partial update to Cody Gateway access granted to this subscription.
Example
{"codyGatewayAccess": UpdateCodyGatewayAccessInput}

UpdateQueue

Description

The state of a repository in the update queue.

Fields
Field Name Description
index - Int! The index of the repo in the update queue. Updating repos are placed at the end of the queue until they finish updating so don't display this if updating is true.
updating - Boolean! True if the repo is currently updating.
total - Int! The total number of repos in the update queue (including updating repos).
Example
{"index": 123, "updating": false, "total": 987}

UpdateSchedule

Description

The state of a repository in the update schedule.

Fields
Field Name Description
intervalSeconds - Int! The interval that was used when scheduling the current due time.
due - DateTime! The next time that the repo will be inserted into the update queue.
index - Int! The index of the repo in the schedule.
total - Int! The total number of repos in the schedule.
Example
{
  "intervalSeconds": 123,
  "due": "2007-12-03T10:15:30Z",
  "index": 987,
  "total": 123
}

UpdateSettingsPayload

Description

The payload for SettingsMutation.updateConfiguration.

Fields
Field Name Description
empty - EmptyResponse An empty response.
Example
{"empty": EmptyResponse}

UpdateSignalConfigurationsInput

Description

UpdateSignalConfigurationsInput represents the input for updating multiple signal configurations.

Fields
Input Field Description
configs - [OwnSignalConfigurationUpdate!]! The signal configuration updates.
Example
{"configs": [OwnSignalConfigurationUpdate]}

UpgradeReadiness

Description

Instance upgrade readiness information includes schema drifts and deprecated-but-unfinished out-of-band migrations.

Fields
Field Name Description
schemaDrift - [SchemaDriftSummary!]! The schema drift details.
requiredOutOfBandMigrations - [OutOfBandMigration!]! The list of deprecated-but-unfinished out-of-band migrations.
Example
{
  "schemaDrift": [SchemaDriftSummary],
  "requiredOutOfBandMigrations": [OutOfBandMigration]
}

User

Description

A user.

Fields
Field Name Description
executorSecrets - ExecutorSecretConnection! The list of all available executor secrets for execution in this users namespace.
Arguments
scope - ExecutorSecretScope!

The scope for which secrets shall be returned.

first - Int

Only return N records.

after - String

Opaque cursor for pagination.

id - ID! The unique ID for the user.
username - String! The user's username.
email - String! The user's primary email address. Only the user and site admins can access this field. use emails instead
displayName - String The display name chosen by the user.
avatarURL - String The URL of the user's avatar image.
url - String! The URL to the user's profile on Sourcegraph.
settingsURL - String The URL to the user's settings.
createdAt - DateTime! The date when the user account was created on Sourcegraph.
updatedAt - DateTime The date when the user account was last updated on Sourcegraph.
siteAdmin - Boolean! Whether the user is a site admin. Only the user and site admins can access this field.
builtinAuth - Boolean! Whether the user account uses built in auth.
latestSettings - Settings The latest settings for the user. Only the user and site admins can access this field.
settingsCascade - SettingsCascade! All settings for this user, and the individual levels in the settings cascade (global > organization > user) that were merged to produce the final merged settings. Only the user and site admins can access this field.
configurationCascade - ConfigurationCascade! DEPRECATED Use settingsCascade instead. This field is a deprecated alias for it and will be removed in a future release.
organizations - OrgConnection! The organizations that this user is a member of.
organizationMemberships - OrganizationMembershipConnection! This user's organization memberships.
tosAccepted - Boolean! Whether the user has already accepted the terms of service or not.
usageStatistics - UserUsageStatistics! The user's usage statistics on Sourcegraph.
eventLogs - EventLogsConnection! The user's events on Sourcegraph.
Arguments
first - Int

Returns the first n event logs from the list.

eventName - String

Only return events matching this event name

emails - [UserEmail!]! The user's email addresses. Only the user and site admins can access this field.
hasVerifiedEmail - Boolean! Whether the user has a verified email or not. Only the user and site admins can access this field.
completedPostSignup - Boolean! Whether the user has completed the post-signup flow. Only the user and site admins can access this field.
primaryEmail - UserEmail The user's verified primary email address (if any). On dotcom only the user and site admins can access this field.
accessTokens - AccessTokenConnection! The user's access tokens (which grant to the holder the privileges of the user). This consists of all access tokens whose subject is this user. Only the user and site admins can access this field.
Arguments
first - Int

Returns the first n access tokens from the list.

externalAccounts - ExternalAccountConnection! A list of external accounts that are associated with the user.
Arguments
first - Int

Returns the first n external accounts from the list.

session - Session! The user's currently active session. Only the currently authenticated user can access this field. Site admins are not able to access sessions for other users.
viewerCanAdminister - Boolean! Whether the viewer has admin privileges on this user. The user has admin privileges on their own user, and site admins have admin privileges on all users.
viewerCanChangeUsername - Boolean! Whether the viewer can change the username of this user. The user can change their username unless auth.disableUsernameChanges is set. Site admins can always change the username of any user.
surveyResponses - [SurveyResponse!]! The user's survey responses. Only the user and site admins can access this field.
databaseID - Int! The unique numeric ID for the user. FOR INTERNAL USE ONLY.
namespaceName - String! The name of this user namespace's component. For users, this is the username.
scimControlled - Boolean! Whether the user is controlled externally through SCIM.
roles - RoleConnection! The list of all roles assigned to this user.
Arguments
first - Int

The limit argument for forward pagination.

last - Int

The limit argument for backward pagination.

after - String

The cursor argument for forward pagination.

before - String

The cursor argument for backward pagination.

permissions - PermissionConnection! The list of permissions granted to this user based on their roles.
completionsQuotaOverride - Int The configured override for the user to the completions request quota per day. Null, if not overwritten.
codeCompletionsQuotaOverride - Int The configured override for the user to the code completions request quota per day. Null, if not overwritten.
codySubscription - CodySubscription The Cody subscription details for the user.
codyProEnabled - Boolean! DEPRECATED Whether the user has enrolled for Cody Pro.
codyCurrentPeriodChatUsage - Int! The count of Cody chats in the current billing period.
codyCurrentPeriodCodeUsage - Int! The count of Cody code completions in the current billing period.
codyCurrentPeriodChatLimit - Int! The limit of Cody chats for the current billing period.
codyCurrentPeriodCodeLimit - Int! The limit of Cody code completions for the current billing period.
teams - TeamConnection! All the teams this user is a direct member of.
Arguments
first - Int

Returns the first n teams from the list.

after - String

Opaque pagination cursor.

search - String

Optionally apply a text search filter over the results.

batchChanges - BatchChangeConnection! A list of batch changes applied under this user's namespace.
Arguments
first - Int

Returns the first n batch changes from the list.

after - String

Opaque pagination cursor.

state - BatchChangeState

Only return batch changes in this state. If states is also specified, it will take precedence over state.

states - [BatchChangeState!]

Only return batch changes in any of these states. If state is also specified, states will take precedence over it.

viewerCanAdminister - Boolean

Only include batch changes that the viewer can administer.

batchChangesCodeHosts - BatchChangesCodeHostConnection! Returns a connection of configured external services accessible by this user, for usage with batch changes. These are all code hosts configured on the Sourcegraph instance that are supported by batch changes. They are connected to BatchChangesCredential resources, if one has been created for the code host connection before.
Arguments
first - Int

Returns the first n code hosts from the list.

after - String

Opaque pagination cursor.

Example
{
  "executorSecrets": ExecutorSecretConnection,
  "id": "4",
  "username": "abc123",
  "email": "xyz789",
  "displayName": "xyz789",
  "avatarURL": "abc123",
  "url": "xyz789",
  "settingsURL": "abc123",
  "createdAt": "2007-12-03T10:15:30Z",
  "updatedAt": "2007-12-03T10:15:30Z",
  "siteAdmin": false,
  "builtinAuth": false,
  "latestSettings": Settings,
  "settingsCascade": SettingsCascade,
  "configurationCascade": ConfigurationCascade,
  "organizations": OrgConnection,
  "organizationMemberships": OrganizationMembershipConnection,
  "tosAccepted": false,
  "usageStatistics": UserUsageStatistics,
  "eventLogs": EventLogsConnection,
  "emails": [UserEmail],
  "hasVerifiedEmail": false,
  "completedPostSignup": false,
  "primaryEmail": UserEmail,
  "accessTokens": AccessTokenConnection,
  "externalAccounts": ExternalAccountConnection,
  "session": Session,
  "viewerCanAdminister": true,
  "viewerCanChangeUsername": false,
  "surveyResponses": [SurveyResponse],
  "databaseID": 987,
  "namespaceName": "xyz789",
  "scimControlled": false,
  "roles": RoleConnection,
  "permissions": PermissionConnection,
  "completionsQuotaOverride": 987,
  "codeCompletionsQuotaOverride": 123,
  "codySubscription": CodySubscription,
  "codyProEnabled": false,
  "codyCurrentPeriodChatUsage": 987,
  "codyCurrentPeriodCodeUsage": 987,
  "codyCurrentPeriodChatLimit": 123,
  "codyCurrentPeriodCodeLimit": 987,
  "teams": TeamConnection,
  "batchChanges": BatchChangeConnection,
  "batchChangesCodeHosts": BatchChangesCodeHostConnection
}

UserActivePeriod

Description

A period of time in which a set of users have been active.

Values
Enum Value Description

TODAY

Since today at 00:00 UTC.

THIS_WEEK

Since the latest Monday at 00:00 UTC.

THIS_MONTH

Since the first day of the current month at 00:00 UTC.

ALL_TIME

All time.
Example
"TODAY"

UserConnection

Description

A list of users.

Fields
Field Name Description
nodes - [User!]! A list of users.
totalCount - Int! The total count of users in the connection. This total count may be larger than the number of nodes in this object when the result is paginated.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [User],
  "totalCount": 123,
  "pageInfo": PageInfo
}

UserEmail

Description

A user's email address.

Fields
Field Name Description
email - String! The email address.
isPrimary - Boolean! Whether the email address is the user's primary email address. Currently this is defined as the earliest email address associated with the user, preferring verified emails to unverified emails.
verified - Boolean! Whether the email address has been verified by the user.
verificationPending - Boolean! Whether the email address is pending verification.
user - User! The user associated with this email address.
viewerCanManuallyVerify - Boolean! Whether the viewer has privileges to manually mark this email address as verified (without the user going through the normal verification process). Only site admins have this privilege.
Example
{
  "email": "abc123",
  "isPrimary": false,
  "verified": true,
  "verificationPending": true,
  "user": User,
  "viewerCanManuallyVerify": true
}

UserEvent

Description

A user event.

Values
Enum Value Description

PAGEVIEW

SEARCHQUERY

CODEINTEL

CODEINTELREFS

CODEINTELINTEGRATION

CODEINTELINTEGRATIONREFS

STAGEMANAGE

Product stages

STAGEPLAN

STAGECODE

STAGEREVIEW

STAGEVERIFY

STAGEPACKAGE

STAGEDEPLOY

STAGECONFIGURE

STAGEMONITOR

STAGESECURE

STAGEAUTOMATE

Example
"PAGEVIEW"

UserUsageStatistics

Description

UserUsageStatistics describes a user's usage statistics. This information is visible to all viewers.

Fields
Field Name Description
searchQueries - Int! The number of search queries that the user has performed.
pageViews - Int! The number of page views that the user has performed.
codeIntelligenceActions - Int! The number of code intelligence actions that the user has performed.
findReferencesActions - Int! The number of find-refs actions that the user has performed.
lastActiveTime - String The last time the user was active (any action, any platform).
lastActiveCodeHostIntegrationTime - String The last time the user was active on a code host integration.
Example
{
  "searchQueries": 987,
  "pageViews": 987,
  "codeIntelligenceActions": 123,
  "findReferencesActions": 987,
  "lastActiveTime": "abc123",
  "lastActiveCodeHostIntegrationTime": "abc123"
}

VirtualFile

Description

A virtual file is an arbitrary file that is generated in memory.

Fields
Field Name Description
path - String! The full path (relative to the root) of this file.
name - String! The base name (i.e., file name only) of this file.
isDirectory - Boolean! False because this is a file, not a directory.
content - String! The content of this file.
Arguments
startLine - Int

Return file content starting at line "startLine". A value <= 0 will be the start of the file.

endLine - Int

Return file content ending at line "endLine". A value < 0 or > totalLines will set endLine to the end of the file.

byteSize - Int! The file size in bytes.
totalLines - Int! Total line count for the file. Returns 0 for binary files.
binary - Boolean! Whether or not it is binary.
richHTML - String! The file rendered as rich HTML, or an empty string if it is not a supported rich file type. This HTML string is already escaped and thus is always safe to render.
Arguments
startLine - Int

Return richHTML content starting at line "startLine". A value <= 0 will be the start of the file.

endLine - Int

Return richHTML content ending at line "endLine". A value < 0 or > totalLines will set endLine to the end of the file.

url - String! Not implemented.
canonicalURL - String! Not implemented.
changelistURL - String Not impleemented.
externalURLs - [ExternalLink!]! Not implemented.
highlight - HighlightedFile! Highlight the file.
Arguments
disableTimeout - Boolean!
highlightLongLines - Boolean

If highlightLongLines is true, lines which are longer than 2000 bytes are highlighted. 2000 bytes is enabled. This may produce a significant amount of HTML which some browsers (such as Chrome, but not Firefox) may have trouble rendering efficiently.

format - HighlightResponseFormat

Specifies which format/highlighting technique to use.

startLine - Int

Return highlight content starting at line "startLine". A value <= 0 will be the start of the file. Warning: Pagination only works with the HTML_PLAINTEXT format type at the moment.

endLine - Int

Return highlight content ending at line "endLine". A value < 0 or > totalLines will set endLine to the end of the file. Warning: Pagination only works with the HTML_PLAINTEXT format type at the moment.

languages - [String!]!

The language(s) determined based on the file's name and contents.

The resulting array may be empty if no language could be determined, or it may have multiple entries if the language is ambiguous.

If there are multiple entries, they will be sorted in descending order of likelihood.

Example
{
  "path": "abc123",
  "name": "xyz789",
  "isDirectory": true,
  "content": "xyz789",
  "byteSize": 123,
  "totalLines": 123,
  "binary": true,
  "richHTML": "abc123",
  "url": "abc123",
  "canonicalURL": "abc123",
  "changelistURL": "abc123",
  "externalURLs": [ExternalLink],
  "highlight": HighlightedFile,
  "languages": ["abc123"]
}

VisibleApplyPreviewTargets

Description

A preview entry to a repository to which the user has access.

Example
VisibleApplyPreviewTargetsAttach

VisibleApplyPreviewTargetsAttach

Description

A preview entry where no changeset existed before matching the changeset spec.

Fields
Field Name Description
changesetSpec - VisibleChangesetSpec! The changeset spec from this entry.
Example
{"changesetSpec": VisibleChangesetSpec}

VisibleApplyPreviewTargetsDetach

Description

A preview entry where no changeset spec exists for the changeset currently in the target batch change.

Fields
Field Name Description
changeset - ExternalChangeset! The changeset from this entry.
Example
{"changeset": ExternalChangeset}

VisibleApplyPreviewTargetsUpdate

Description

A preview entry where a changeset matches the changeset spec.

Fields
Field Name Description
changesetSpec - VisibleChangesetSpec! The changeset spec from this entry.
changeset - ExternalChangeset! The changeset from this entry.
Example
{
  "changesetSpec": VisibleChangesetSpec,
  "changeset": ExternalChangeset
}

VisibleBatchSpecWorkspace

Description

A workspace to which the requesting user has access.

Fields
Field Name Description
id - ID! The unique ID for the workspace.
repository - Repository! The repository to run over.
batchSpec - BatchSpec! Used for reverse querying.
branch - GitRef! The branch to run over.
path - String! The path to run in.
onlyFetchWorkspace - Boolean! If true, only the files within the workspace will be fetched.
ignored - Boolean! If true, this workspace has been skipped, because some rule forced this. For now, the only one is a .batchignore file existing in the repository.
unsupported - Boolean! If true, this workspace has been skipped, because the code host on which the repository is hosted is not supported.
cachedResultFound - Boolean! Whether we found a task cache result.
stepCacheResultCount - Int! How many steps had a cached result.
stages - BatchSpecWorkspaceStages Executor stages of running in this workspace. Null, if the execution hasn't started yet.
steps - [BatchSpecWorkspaceStep!]! List of steps that will need to run over this workspace.
step - BatchSpecWorkspaceStep Get a specific step by its index. Index is 1-based.
Arguments
index - Int!
searchResultPaths - [String!]! If this workspace was resolved based on a search, this is the list of paths to files that have been included in the search results.
queuedAt - DateTime The time when the workspace was enqueued for processing. Null, if not yet enqueued.
startedAt - DateTime The time when the workspace started processing. Null, if not yet started.
finishedAt - DateTime The time when the workspace finished processing. Null, if not yet finished.
failureMessage - String Optional failure message, set when the execution failed.
state - BatchSpecWorkspaceState! The current state the workspace is in.
changesetSpecs - [VisibleChangesetSpec!] Populated, when the execution is finished. This is where you get the combined diffs.
placeInQueue - Int The rank of this execution in the queue of the user. The value of this field is null if the execution has started.
placeInGlobalQueue - Int The rank of this execution in the global queue. The value of this field is null if the execution has started.
diffStat - DiffStat The diff stat over all created changeset specs. Null, if not yet finished or failed.
executor - Executor The executor that picked up this job. Null, if the executor has been pruned from the data set or if the job has not started yet. Only available to site-admins.
Example
{
  "id": 4,
  "repository": Repository,
  "batchSpec": BatchSpec,
  "branch": GitRef,
  "path": "xyz789",
  "onlyFetchWorkspace": true,
  "ignored": false,
  "unsupported": true,
  "cachedResultFound": false,
  "stepCacheResultCount": 987,
  "stages": BatchSpecWorkspaceStages,
  "steps": [BatchSpecWorkspaceStep],
  "step": BatchSpecWorkspaceStep,
  "searchResultPaths": ["abc123"],
  "queuedAt": "2007-12-03T10:15:30Z",
  "startedAt": "2007-12-03T10:15:30Z",
  "finishedAt": "2007-12-03T10:15:30Z",
  "failureMessage": "xyz789",
  "state": "SKIPPED",
  "changesetSpecs": [VisibleChangesetSpec],
  "placeInQueue": 123,
  "placeInGlobalQueue": 123,
  "diffStat": DiffStat,
  "executor": Executor
}

VisibleChangesetApplyPreview

Description

One preview entry in the list of all previews against a batch spec. Each mapping between changeset specs and current changesets yields one of these. It describes which operations are taken against which changeset spec and changeset to ensure the desired state is met.

Fields
Field Name Description
operations - [ChangesetSpecOperation!]! The operations to take to achieve the desired state.
delta - ChangesetSpecDelta! The delta between the current changeset state and what the new changeset spec envisions the changeset to look like.
targets - VisibleApplyPreviewTargets! The target entities in this preview entry.
Example
{
  "operations": ["PUSH"],
  "delta": ChangesetSpecDelta,
  "targets": VisibleApplyPreviewTargetsAttach
}

VisibleChangesetSpec

Description

A changeset spec is an immutable description of the desired state of a changeset in a batch change. To create a changeset spec, use the createChangesetSpec mutation.

Fields
Field Name Description
id - ID!

The unique ID for a changeset spec.

The ID is unguessable (i.e., long and randomly generated, not sequential). This is important even though repository permissions also apply to viewers of changeset specs, because being allowed to view a repository should not entitle a person to view all not-yet-published changesets for that repository. Consider a batch change to fix a security vulnerability: the batch change author may prefer to prepare all of the changesets in private so that the window between revealing the problem and merging the fixes is as short as possible.

type - ChangesetSpecType! The type of changeset spec.
description - ChangesetDescription! The description of the changeset.
expiresAt - DateTime The date, if any, when this changeset spec expires and is automatically purged. A changeset spec never expires (and this field is null) if its batch spec has been applied.
forkTarget - ForkTarget The fork the changeset will be pushed to, if any.
workspace - BatchSpecWorkspace The workspace this resulted from. Null, if not run server-side.
Example
{
  "id": 4,
  "type": "EXISTING",
  "description": ExistingChangesetReference,
  "expiresAt": "2007-12-03T10:15:30Z",
  "forkTarget": ForkTarget,
  "workspace": BatchSpecWorkspace
}

Vulnerability

Description

Vulnerabilities synced from the GitHub Advisory Database.

Fields
Field Name Description
id - ID! The ID of the vulnerability.
sourceID - String! The CVE identifier of the vulnerability (e.g., CVE-2023-123).
summary - String! A short summary of the vulnerability.
details - String! A longer description of the vulnerability.
cpes - [String!]! Common Platform Enumeration identifiers related to this vulnerability.
cwes - [String!]! Common Weakness Enumeration identifiers related to this vulnerability.
aliases - [String!]! Other names this vulnerability is known by.
related - [String!]! Names of related vulnerabilities.
dataSource - String! The data source of this vulnerability.
urls - [String!]! URLs indicating the source of this vulnerability.
severity - String! A human-readable severity string.
cvssVector - String! The Common Vulnerability Scoring System severity vector.
cvssScore - String! The Common Vulnerability Scoring System severity score.
published - DateTime! The time this vulnerability was published.
modified - DateTime The last time this vulnerability was modified.
withdrawn - DateTime The time this vulnerability was withdrawn.
affectedPackages - [VulnerabilityAffectedPackage!]! A list of packages that are affected by this vulnerability.
Example
{
  "id": "4",
  "sourceID": "abc123",
  "summary": "xyz789",
  "details": "abc123",
  "cpes": ["xyz789"],
  "cwes": ["abc123"],
  "aliases": ["abc123"],
  "related": ["xyz789"],
  "dataSource": "xyz789",
  "urls": ["abc123"],
  "severity": "xyz789",
  "cvssVector": "xyz789",
  "cvssScore": "abc123",
  "published": "2007-12-03T10:15:30Z",
  "modified": "2007-12-03T10:15:30Z",
  "withdrawn": "2007-12-03T10:15:30Z",
  "affectedPackages": [VulnerabilityAffectedPackage]
}

VulnerabilityAffectedPackage

Description

A package affected by a vulnerability.

Fields
Field Name Description
packageName - String! The name of the package.
language - String! The language ecosystem.
namespace - String! A package namespace.
versionConstraint - [String!]! A list of constraints that identify affected versions of the package.
fixed - Boolean! Whether or not there is a known fix.
fixedIn - String The version in which the fix was applied.
affectedSymbols - [VulnerabilityAffectedSymbol!]! A list of specific symbols affected by the vulnerability.
Example
{
  "packageName": "abc123",
  "language": "abc123",
  "namespace": "abc123",
  "versionConstraint": ["abc123"],
  "fixed": false,
  "fixedIn": "xyz789",
  "affectedSymbols": [VulnerabilityAffectedSymbol]
}

VulnerabilityAffectedSymbol

Description

A specific symbol affected by a vulnerability.

Fields
Field Name Description
path - String! A path to the document within the package source.
symbols - [String!]! A list of symbols defined in that path.
Example
{
  "path": "abc123",
  "symbols": ["abc123"]
}

VulnerabilityConnection

Description

A page of vulnerabilities.

Fields
Field Name Description
nodes - [Vulnerability!]! The vulnerabilities on the page.
totalCount - Int The total number of vulnerabilities across all pages.
pageInfo - PageInfo! Information on how to fetch the next page.
Example
{
  "nodes": [Vulnerability],
  "totalCount": 987,
  "pageInfo": PageInfo
}

VulnerabilityMatch

Description

A use of a known vulnerable-affected package.e

Fields
Field Name Description
id - ID! The match ID.
vulnerability - Vulnerability! The vulnerability.
affectedPackage - VulnerabilityAffectedPackage! The affected package that is used by the associated index.
preciseIndex - PreciseIndex! The index record that contains a direct use of the affected package.
Example
{
  "id": 4,
  "vulnerability": Vulnerability,
  "affectedPackage": VulnerabilityAffectedPackage,
  "preciseIndex": PreciseIndex
}

VulnerabilityMatchConnection

Description

A page of vulnerability matches.

Fields
Field Name Description
nodes - [VulnerabilityMatch!]! The vulnerability matches on the page.
totalCount - Int The total number of vulnerability matches across all pages.
pageInfo - PageInfo! Information on how to fetch the next page.
Example
{
  "nodes": [VulnerabilityMatch],
  "totalCount": 987,
  "pageInfo": PageInfo
}

VulnerabilityMatchCountByRepository

Description

Vulnerability matches count group by repository.

Fields
Field Name Description
id - ID! The id of the grouping.
repositoryName - String! The repository name.
matchCount - Int! The vulnerability matches count.
Example
{
  "id": 4,
  "repositoryName": "xyz789",
  "matchCount": 987
}

VulnerabilityMatchCountByRepositoryConnection

Description

A page of vulnerability matches grouped by repository.

Fields
Field Name Description
nodes - [VulnerabilityMatchCountByRepository!]! The vulnerability matches on the page.
totalCount - Int The total number of vulnerability matches across all pages.
pageInfo - PageInfo! Information on how to fetch the next page.
Example
{
  "nodes": [VulnerabilityMatchCountByRepository],
  "totalCount": 987,
  "pageInfo": PageInfo
}

VulnerabilityMatchesSummaryCount

Description

A count of the severities of vulnerability matches.

Fields
Field Name Description
critical - Int! The number of matches with a severity of "CRITICAL".
high - Int! The number of matches with a severity of "HIGH".
medium - Int! The number of matches with a severity of "MEDIUM".
low - Int! The number of matches with a severity of "LOW".
repository - Int! The number of repos with a severity
Example
{"critical": 987, "high": 123, "medium": 123, "low": 987, "repository": 987}

Webhook

Description

Represents an incoming webhook from a code host.

Fields
Field Name Description
id - ID! The unique ID of the webhook.
uuid - String! The user facing UUID of the webhook.
url - String! The URL of the webhook in the instance. This is the location where we expect to receive payloads.
name - String! Descriptive webhook name.
codeHostKind - ExternalServiceKind! The kind of code host sending payloads. (eg. GitHub, GitLab)
codeHostURN - String! The URN of the code host instance. (eg. https://gitlab.com)
secret - String Optional secret.
updatedAt - DateTime! The last time this webhook was updated.
updatedBy - User The user who last updated this webhook. Null if the user was deleted or if the webhook hasn't been updated yet.
createdAt - DateTime! When the webhook was created.
createdBy - User The user who created this webhook. Null if the user was deleted.
webhookLogs - WebhookLogConnection! The logs related to this webhook.
Arguments
first - Int

Returns the first n webhook logs.

after - String

Opaque pagination cursor.

onlyErrors - Boolean

Only include webhook logs that resulted in errors.

since - DateTime

Only include webhook logs on or after this time.

until - DateTime

Only include webhook logs on or before this time.

Example
{
  "id": 4,
  "uuid": "xyz789",
  "url": "abc123",
  "name": "abc123",
  "codeHostKind": "AWSCODECOMMIT",
  "codeHostURN": "xyz789",
  "secret": "abc123",
  "updatedAt": "2007-12-03T10:15:30Z",
  "updatedBy": User,
  "createdAt": "2007-12-03T10:15:30Z",
  "createdBy": User,
  "webhookLogs": WebhookLogConnection
}

WebhookConnection

Description

A list of webhooks

Fields
Field Name Description
nodes - [Webhook!]! A list of webhooks.
totalCount - Int! The total number of webhooks in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [Webhook],
  "totalCount": 987,
  "pageInfo": PageInfo
}

WebhookLog

Description

A single logged webhook delivery.

Fields
Field Name Description
id - ID! The webhook log ID.
receivedAt - DateTime! The time the webhook was received at.
externalService - ExternalService The external service the webhook was matched to, if any.
statusCode - Int! The HTTP status code returned from the webhook handler.
request - WebhookLogRequest! The received webhook request.
response - WebhookLogResponse! The response sent by the webhook handler.
Example
{
  "id": 4,
  "receivedAt": "2007-12-03T10:15:30Z",
  "externalService": ExternalService,
  "statusCode": 987,
  "request": WebhookLogRequest,
  "response": WebhookLogResponse
}

WebhookLogConnection

Description

A list of logged webhook deliveries.

Fields
Field Name Description
nodes - [WebhookLog!]! A list of webhook logs.
totalCount - Int! The total number of webhook logs in the connection.
pageInfo - PageInfo! Pagination information.
Example
{
  "nodes": [WebhookLog],
  "totalCount": 123,
  "pageInfo": PageInfo
}

WebhookLogMessage

Description

A HTTP message (request or response) within a webhook log.

Fields
Field Name Description
headers - [HTTPHeader!]! The headers in the HTTP message.
body - String! The body content of the HTTP message.
Possible Types
WebhookLogMessage Types

WebhookLogRequest

WebhookLogResponse

Example
{
  "headers": [HTTPHeader],
  "body": "abc123"
}

WebhookLogRequest

Description

A HTTP request within a webhook log.

Fields
Field Name Description
headers - [HTTPHeader!]! The headers in the HTTP message.
body - String! The body content of the HTTP message.
method - String! The method used in the HTTP request.
url - String! The requested URL.
version - String! The HTTP version in use.
Example
{
  "headers": [HTTPHeader],
  "body": "abc123",
  "method": "abc123",
  "url": "abc123",
  "version": "abc123"
}

WebhookLogResponse

Description

A HTTP response within a webhook log.

Fields
Field Name Description
headers - [HTTPHeader!]! The headers in the HTTP message.
body - String! The body content of the HTTP message.
Example
{
  "headers": [HTTPHeader],
  "body": "abc123"
}

WorkspacesSortOrder

Description

Possible sort orderings for a workspace connection.

Values
Enum Value Description

REPO_NAME_ASC

Sort by repository name in ascending order.

REPO_NAME_DESC

Sort by repository name in descending order.
Example
"REPO_NAME_ASC"

repositoryIndexserverHost

Description

Information about the indexserver that hosts the repo's index.

Fields
Field Name Description
name - String! The hostname of the indexserver.
Example
{"name": "xyz789"}